Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Load images into a form using GDIPlus library
Message
From
06/10/2004 12:19:48
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00949200
Message ID:
00949236
Views:
13
Paul,

According to Walter Nicholls' first GDI+ article in the August FoxTalk, you have to be sure to initialize the GDIPLUS DLL before calling the GDI+ classes. One very simple way to do that is:
CREATEOBJECT("reportlistener")
That got rid of the DLL exception for me.

>I'm playing around with the new FFC GDI classes and I can't seem to get this to work (I'm sure I'm missing something really simple). I basically want to load a graphics image onto a VFP form, resized to a shape sitting on that form. Here's some code to outline what I'm trying to do (of course, it doesn't work):
>
>
>oForm = CREATEOBJECT("Form")
>oForm.Visible = .T.
>oForm.AddObject("ctrShape", "Shape")
>oForm.ctrShape.Visible = .T.
>oForm.ctrShape.Width = 200
>oForm.ctrShape.Height = 200
>
>oGDI = CREATEOBJECT("GPGraphics")
>oGDIImage = CREATEOBJECT("GPImage")
>?oGDI.SetHandle(oForm.HWnd)
>?oGDIImage.SetHandle(oForm.HWnd)
>?oGDIImage.CreateFromFile("C:\SampleImage.jpg")
>
>* I get a DLL exception here
>?oGDI.DrawImageScaled(oGDIImage, oForm.ctrShape.Left, oForm.ctrShape.Top, oForm.ctrShape.Width, oForm.ctrShape.Height)
>
>
>Any ideas would be appreciated.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform