FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour New GdiPlus Classes for FWH 11.10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New GdiPlus Classes for FWH 11.10
Posted: Thu Oct 06, 2011 06: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 (fw): Select all Collapse
// GdiPlus example following Microsoft tutorial:
// <!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/ms533895(v=VS.85">http://msdn.microsoft.com/en-us/library ... 95(v=VS.85</a><!-- m -->).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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: New GdiPlus Classes for FWH 11.10
Posted: Thu Oct 06, 2011 03: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: New GdiPlus Classes for FWH 11.10
Posted: Thu Oct 06, 2011 03: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: New GdiPlus Classes for FWH 11.10
Posted: Fri Oct 07, 2011 08: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: New GdiPlus Classes for FWH 11.10
Posted: Fri Oct 07, 2011 02: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion