Thursday, August 04, 2005

Well, the first article in my GDI+ series for FoxTalk 2.0 is available online for free today. Thanks to FoxTalk 2.0 for everything they've done for me and the rest of the Visual FoxPro Community, especially David Stevenson my editor at FoxTalk 2.0. He put in a lot of hard work to make this article possible (as I am sure he has done for all the FoxTalk 2.0 articles).

This first article will take the reader through the basics of drawing on Visual FoxPro forms with GDI+ using double-buffering and other techniques that make GDI+ more useable for Visual FoxPro developers. It'll show you how to surmount many of the inherent problems developers encounter when rendering graphics on Visual FoxPro forms using GDI+.

Stay tuned for the next articles in the series where I'll build from this first article and delve even further into GDI+ and it's many uses in Visual FoxPro.

Thursday, August 04, 2005 7:38:13 PM (Central Daylight Time, UTC-05:00)  #    Comments [4]
Wednesday, August 17, 2005 2:54:20 AM (Central Daylight Time, UTC-05:00)
Hi Craig !
Terrific !

I've been working with GDI+ since last year, and had given up working directly with the hWND, since the form could loose the contents drawn with GDI+.

I work with a modified version of Alexander Golovlev's GPIMAGE.PRG. With his help and permission, we introduced a GRAPHIC class to GPIMAGE, that works with the Graphics object and Image Attributes.

As I still work with VFP7, I had to add these functions.

You can check it at http://cchalom.sites.uol.com.br/GPIMAGE/index.htm

My solution was to add an image object, and link it with a BMP or JPEG created with GDI+. On Resize method of the form, I Redraw the image, save it again to a file and reload the Image object. The final result is almost the same of the example you teached in your great article. But maybe this will cost some more work to VFP to do, as it needs to acess the disk many times during Resizements.

What do you think of that ?
Do you see any way to do the same approach you teached using VFP7. I can't imagine how I colud bind the related event.

Congratulations !
Wednesday, August 17, 2005 3:16:57 AM (Central Daylight Time, UTC-05:00)
In INIT of Sample2.scx of this article, you make use of BINDEVENT

=BINDEVENT(.realhwnd, WM_ERASEBKGND, THIS,'WinEventHandler')
=BINDEVENT(.realhwnd, WM_PAINT, THIS, "WinEventHandler")

Extending it with your other great BLOG post "BindEvent on Steroids", I suppose that using the FLL you gifted us, It is possible to simulate BINDEVENT ?!?!?!?
In your examples, could we use
BindEventEx('oform1.wineventhandler()', WM_PAINT)

Thanks again!
Best regards
Cesar
Friday, November 18, 2005 12:56:18 AM (Central Standard Time, UTC-06:00)
Hi Cesar,

It is not possible to do this in VFP 7, not at least the way I show using BindEvent(). I guess an FLL could be created pretty easily to bind to the windows message events, but I just don't have the time or interest in creating such a thing as later versions of VFP already have it. If the resize is working for your needs then I would say go with it, it will probably fail under certain conditions, but if it works for what you are using it for then these potential failures are not an issue.

The BindEventEx that I created works with different events than VFP's BindEvent(), such as global keyboard and mouse hooks, or the really cool CBT events that Windows fires.
Wednesday, September 05, 2007 3:54:44 PM (Central Daylight Time, UTC-05:00)
Hello Cesar,

I have a FoxPro project with complex charting requirements. I dug through my old FoxTalk2 mags and found your articles on GDI+. They were/are very helpful. When I tried to download the source code from the FoxTalk web site they were not available. The archive goes back to 2006 December only. Can I download the sample code from somewhere else?
Attila Dobozi
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u)  

Enter the code shown (prevents robots):


 

Archive

<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456