Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I save an image with GDIPlusX
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01301519
Message ID:
01301590
Vues:
15
>Hi Cesar, it's me again. Sorry but I can't seem to get thing to work yet. You said to save it 'after you've drawn in the image canvas'. I can't figure out how to get the draw to work in the form.imgCanvas. Do I load the file in the image imgCanvas container using Picture = 'C:\MYFILE.PNG' or do I have to load it another way. Either way, how do I run the Draw? I tried using the draw method on the image canvas but I got an error saying Draw did not exist.


Here's a simple way to draw an image:

In the BeforeDraw event of the ImgCanvas, try:
local loBmp as xfcBitmap
local loGfx as xfcGraphics
loGfx = This.oGfx

With _Screen.System.Drawing
   loBmp = .Bitmap.FromFile(GETPICT())

   * Now let's draw in the Canvas
   loGfx.DrawImage(loBmp, 0,0)

   * Draw a red square
   loGfx.DrawRectangle(.Pens.Red, 10,10,20,20)

EndWith
Please have a look at this tutorial for a better explanation on how to use the Image Canvas object
http://weblogs.foxite.com/vfpimaging//archive/2007/03/20/3535.aspx

HTH

Cesar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform