 |
| GDI+: converting image file to another graphics format |
User rating: 0/10 (0 votes) | | |
|
 |
 |
Versions: click to open |
 |
|
 |
 |
| Before you begin: |
 |
The code is based on custom GDI+ class. Download the class module first and save it in gdiplus.prg file.
Make sure the source and target file names are valid. The source file can be in any of graphics formats supported by the GDI+: BMP, GIF, JPG, TIF, EMF...
|
 |
 |
SET PROCEDURE TO gdiplus ADDITIVE
* an instance of gdiplusinit should be created before
* and released after using any of gdi+ objects
PRIVATE gdiplus
gdiplus = CREATEOBJECT("gdiplusinit")
LOCAL img
img = CREATEOBJECT("gdiimage", "c:\windows\forest.bmp")
WITH img
.SaveToFile("d:\temp\tmp.bmp")
.SaveToFile("d:\temp\tmp.gif")
.SaveToFile("d:\temp\tmp.jpg")
.SaveToFile("d:\temp\tmp.png")
.SaveToFile("d:\temp\tmp.tif")
ENDWITH
|
 |
User rating: 0/10 (0 votes) | | | 452 bytes Created: 2004-07-05 19:40:43 Modified: 2011-12-10 09:20:22 Visits in 7 days: 69 |
|
 |
 |
| Listed functions: |
 |
|
 |
 |
| My comment: |
 |
The base class has encoder CLSIDs implemented as constants. Event though it works perfectly, in real-life programming I suggest using the GdipGetImageEncoders function to retrieve parameters of the image encoders currently available on the system.
|
 |
 |
| Word Index links for this example: |
 |
|
|
 |
 |
| Translate this page: |
 |
|