Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image of form
Message
From
03/02/2008 17:57:39
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01288760
Message ID:
01288879
Views:
9
>Jos,
>
>You can get a snapshot of a form using the GDIPlusX library, but it includes the title and border. (I can make a change to the library so you get just the client area of the form if it this helps.)
>
>It is pretty straight forward:
>
>
>DO System.APP
>WITH _Screen.System.Drawing
>  ** Get Bitmap object from a VFP form
>  oImg = .Bitmap.FromScreen( oMyForm )
>
>  ** Save to file:
>  oImg.Save("MyForm.jpg", .Imaging.ImageFormat.Jpeg)
>
>  ** Save to variable:
>  oStream = =_Screen.System.IO.MemoryStream.New()
>  oImg.Save(oStream, .Imaging.ImageFormat.Jpeg)
>  cMyForm = oStream.GetBuffer()
>
>ENDWITH
>
>
>You can download the library from http://www.codeplex.com/VFPX/Release/ProjectReleases.aspx?ReleaseId=6446


Hi Bo,

In the samples of GdiPlusX we've added some cool samples showing how to capture onclient window too. Just check for "Capture.Scx"

To store the pictureVal of the captured variable, using the GetPictureVal function is the easiest way, as follows:
cMyForm = oImg.GetPictureVal(Imaging.ImageFormat.Jpeg)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform