Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create a JPG of the contents of a container?
Message
From
18/02/2010 19:52:36
Luis Navas
Independent Consultant
Auckland, New Zealand
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01449835
Message ID:
01449839
Views:
46
>I know somewhere I saw something somewhere about being able to capture part of a screen as a bitmap. It would be great if I could capture the contents of a container and save it as a jpeg, png or whatever. The trick is that I need to do this for multiple VFP containers on the screen and without user intervention other than pressing the Save button. Does anyone know of any sample code or can point me in the right direction?

This is using the GDIPLUX library, and following the samples included with the library,
Do System.app
Local lnTop As Integer, lnLeft As Integer, lnHeight As Integer, lnWidth As Integer
lnTop = Thisform.Container.Top
lnLeft = Thisform.Container.Left
lnHeight = Thisform.Container.Height
lnWidth = Thisform.Container.Width
Local loCaptureBmp As xfcBitmap, lcFileName As String,
lcFileName = Addbs(GetEnv("TEMP")) + "Screenshot.png"
loCaptureBmp = _Screen.System.Drawing.Bitmap.FromScreen(Thisform.HWnd, lnLeft, lnTop, lnWidth, lnHeight)
loCaptureBmp.Save(lcFileName, _Screen.System.Drawing.Imaging.ImageFormat.Png)
I never forget a face, but in your case I will make an exception :-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform