Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a JPG of the contents of a container?
Message
De
18/02/2010 19:52:36
Luis Navas
Independent Consultant
Auckland, Nouvelle Zélande
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01449835
Message ID:
01449839
Vues:
45
>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 :-)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform