Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Picture size
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01010644
Message ID:
01011667
Vues:
23
Hi Geoff,

>Could you elaborate a bit more on which function resizes the graphic?

Sure. The following code takes a delete.bmp, scales it by 200% and stores the new picture as test.bmp in BMP format and as test.jpg in JPEG format.
* Initalize GDI+ library and environment
Set CLASSLIB to Home()+"ffc\_Gdiplus.vcx" Additive
createobject( "ReportListener" )

* Load the original image
Local loFile
loFile = CreateObject("gpBitmap")
loFile.CreateFromFile("delete.bmp")

* new bitmap 3 times as large (scale factor 200%)
Local loBitmap
loBitmap = CreateObject("gpBitmap")
loBitmap.Create(loFile.ImageWidth*3,loFile.ImageHeight*3)

* insert the scaled image into the new bitmap
Local loGP
loGP = CreateObject("gpGraphics")
loGP.CreateFromImage( m.loBitmap )
loGP.DrawImageScaled( m.loFile, 0,0,loFile.ImageWidth*3,loFile.ImageHeight*3 )

* Save as JPG and BMP files.
loBitmap.SaveToFile("test.jpg","image/jpeg")
loBitmap.SaveToFile("test.bmp","image/bmp")
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform