Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a JPG of the contents of a container?
Message
 
À
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:
01449947
Vues:
52
>>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)
>
Wow, all that power in so few lines. I can't thank you enough. I have the latest version of the GDI+ LIB but haven't had a chance to get into it yet.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform