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...
SETPROCEDURETO gdiplus ADDITIVE* an instance of gdiplusinit should be created before* and released after using any of gdi+ objectsPRIVATE gdiplus
gdiplus = CREATEOBJECT("gdiplusinit")LOCAL img
img = CREATEOBJECT("gdiimage", "c:\windows\forest.bmp")WITH img
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.