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'). If the extension is not valid, the type of the currently loaded file is used.

Note:
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.
To abort while saving set Aborting to true


Example

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

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

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