New GdiPlus Classes for FWH 11.10

New GdiPlus Classes for FWH 11.10

Postby Antonio Linares » Thu Oct 06, 2011 6:47 am

Here you have a working example following the Microsoft GdiPlus tutorials:
http://msdn.microsoft.com/en-us/library/ms533895(v=VS.85).aspx

Code: Select all  Expand view
// GdiPlus example following Microsoft tutorial:
// http://msdn.microsoft.com/en-us/library ... 95(v=VS.85).aspx

#include "FiveWin.ch"

function Main()

   local oWnd
   
   DEFINE WINDOW oWnd
   
   ACTIVATE WINDOW oWnd ;
      ON PAINT DrawLine( hDC )

return nil

function DrawLine( hDC )

   local oGraphics := Graphics():New( hDC )
   local oPen := Pen():New( 255, 0, 0, 255 ) // nTransparency, nRed, nGreen, nBlue
   
   oGraphics:DrawLine( oPen, 0, 0, 200, 100 )
   
return nil  
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42084
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: New GdiPlus Classes for FWH 11.10

Postby James Bott » Thu Oct 06, 2011 3:10 pm

Antonio,

Please explain where hDC comes from. It doesn't seem to be defined and yet it is being passed. How does this work?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: New GdiPlus Classes for FWH 11.10

Postby nageswaragunupudi » Thu Oct 06, 2011 3:13 pm

Mr James
Please review the command translate of ACTIVATE WINDOW or examine the PPO. Your doubt will be clarified.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: New GdiPlus Classes for FWH 11.10

Postby Enrico Maria Giordano » Fri Oct 07, 2011 8:21 am

James Bott wrote:Antonio,

Please explain where hDC comes from. It doesn't seem to be defined and yet it is being passed. How does this work?

Regards,
James


It's automatically passed by PAINT method.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: New GdiPlus Classes for FWH 11.10

Postby James Bott » Fri Oct 07, 2011 2:24 pm

Rao and Enrico,

Thanks. I see it in the fivewin.ch file. A codeblock of course. I should have figured that out--I need some sleep.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests