ImageEn, unit imageenio

TImageEnIO.SaveToFile

TImageEnIO.SaveToFile


Declaration


procedure SaveToFile(const FileName: WideString; ImageFormat: TIOFileType = ioUnknown);


Description


Saves the current image to Jpeg, Jpeg2000, PNG, TIFF, BMP, WBMP, PS, PDF, PCX, DCX, TGA, PXM, ICO, HDP, GIF, DICOM and any other supported format.
                                         
FileName is the file name including extension.
If ImageFormat is ioUnknown, then the file format is determined by the extension of the specified filename (e.g. ioJPEG for 'image.jpeg').

Notes:
- You can abort saving by setting Aborting to true
- If an internal save error is encountered Aborting will return true. Saving issues due to insufficient write permissions and disk write failures will raise an exception.


Example


ImageEnView1.IO.SaveToFile('D:\rome.jpg');
ImageEnView1.IO.SaveToFile('D:\florence.tif');
ImageEnView1.IO.SaveToFile('D:\venice.gif');

// Saves a 16 color bitmap
ImageEnView1.IO.Params.BitsPerSample := 4 ;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
ImageEnView1.IO.SaveToFile('D:\Italy.bmp');

// Saves a jpeg into output.dat
ImageEnView1.IO.SaveToFile('D:\output.dat', ioJPEG);