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 13:40:27
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00949200
Message ID:
00949275
Views:
8
Hi Paul,

I was playing around with this stuff last night too. Evidently, an HWnd is not the same thing as a GDI+ Handle. Take a look at the CreateFromHWND() method in the gpGraphics class. There is a CreateFromImage() method in there as well that might be useful.

>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.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Previous
Reply
Map
View

Click here to load this message in the networking platform