LOCAL lcSource, lcDestination m.lcSource = GETPICT() m.lcDestination = JUSTPATH(m.lcSource) + "\_" + JUSTSTEM(m.lcSource) LOCAL loImage AS gpimage OF HOME() + ffc / _gdiplus.vcx m.loImage = NEWOBJECT("gpimage", HOME() + "ffc/_gdiplus.vcx") m.loImage.CreateFromFile(m.lcSource) m.loImage.SaveToFile(m.lcDestination + ".jpg","image/jpeg") m.loImage.SaveToFile(m.lcDestination + ".bmp","image/bmp") m.loImage.SaveToFile(m.lcDestination + ".tif","image/tiff") m.loImage.SaveToFile(m.lcDestination + ".gif","image/gif") m.loImage.SaveToFile(m.lcDestination + ".png","image/png") *!* jpegs allow to choose the quality of the image m.loImage.SaveToFile(m.lcDestination + ".jpg","image/jpeg", "quality=70")
VFP Visual FoxPro and Images, graphics, GdiPlus, GdiPlusX, FoxCharts, FoxPaint, charting, tips and tricks, code samples, VFPX, FoxyPreviewer etc...
2006-02-07
CONVERT IMAGE TYPES WITH VFP9 AND GDI+
The following piece of code loads an image and saves it on the same original folder in the formats supported by GDI+, using the _gdiPlus.vcx class, that you can find in the VFP9 FFC folder:
Subscribe to:
Post Comments (Atom)
Versión en Español de este artículo in / Spanish version at http://www.portalfox.com/article.php?sid=2174
ReplyDelete