Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Resizing images from VFP9 app
Message
De
18/11/2005 06:46:33
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01069788
Message ID:
01070130
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
If you have VFP9, you can try this code, using _gdiplus.vcx

Regards
Cesar
#define	GDIPLUS_PIXELFORMAT_1bppIndexed     	0x00030101
#define	GDIPLUS_PIXELFORMAT_4bppIndexed     	0x00030402
#define	GDIPLUS_PIXELFORMAT_8bppIndexed     	0x00030803
#define	GDIPLUS_PIXELFORMAT_16bppGrayScale  	0x00101004
#define	GDIPLUS_PIXELFORMAT_16bppRGB555     	0x00021005
#define	GDIPLUS_PIXELFORMAT_16bppRGB565     	0x00021006
#define	GDIPLUS_PIXELFORMAT_16bppARGB1555   	0x00061007
#define	GDIPLUS_PIXELFORMAT_24bppRGB        	0x00021808
#define	GDIPLUS_PIXELFORMAT_32bppRGB        	0x00022009
#define	GDIPLUS_PIXELFORMAT_32bppARGB       	0x0026200A
#define	GDIPLUS_PIXELFORMAT_32bppPARGB      	0x000E200B
#define	GDIPLUS_PIXELFORMAT_48bppRGB        	0x0010300C
#define	GDIPLUS_PIXELFORMAT_64bppPARGB      	0x001C400E


lcSource = GETPICT()
lcDestination = "c:\test.bmp"

SET PATH TO HOME(1)

LOCAL loImage AS GpImage of ffc/_gdiplus.vcx
loImage = NEWOBJECT("GpImage", "FFC\_gdiplus.vcx")
loImage.CreateFromFile(lcSource)

LOCAL loBitmap AS GpBitmap of ffc/_gdiplus.vcx
loBitmap = NEWOBJECT("GpBitmap", "ffc/_gdiplus.vcx")
LOCAL loGraphics as GpGraphics of ffc/_gdiplus.vcx
loGraphics = NEWOBJECT('GpGraphics','ffc/_gdiplus.vcx')

*** Now we create a new image with 
*** Create Method - Creates a bitmap object. 
*** Syntax: ? THIS.Create(tnWidth, tnHeight[, tnPixelFormat])
***
***tnPixelFormat, optional, one of GDIPLUS_PIXELFORMAT_* constants, 
***      defaults to GDIPLUS_PIXELFORMAT_32bppARGB.

loBitmap.Create(324,198,GDIPLUS_PIXELFORMAT_16bppRGB565) && The size you specified
*** The other constants are in the beginning of this code

loGraphics.CreateFromImage(loBitmap)
loGraphics.DrawImageScaled(loImage, 0, 0, 324, 198)
loBitmap.SaveToFile(lcDestination, "image/bmp")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform