ImageEn, unit iexBitmaps

TIEMultiBitmap.Write

TIEMultiBitmap.Write


Declaration

function Write(const FileName: string; IOParams: TIOMultiParams = nil): boolean; overload;
function Write(const FileName: string; FileType: TIOFileType; IOParams: TIOMultiParams = nil): boolean; overload;
function Write(Stream: TStream; FileType: TIOFileType; IOParams: TIOMultiParams = nil): boolean; overload;


Description

Write an image to file or stream (including all its frames). This method supports all formats supported by TImageEnMIO class.
If saving to a stream you must specify the FileType. When saving to a file, FileType can be ioUnknown, and the type will be determined by the file extension (e.g. ioTIFF for 'Image.tiff')
You can optionally specify an TIOMultiParams object containing the I/O parameters of the file (see also ParamsEnabled).
Returns true on success.


Examples

var
  mbmp: TIEMultiBitmap;
begin
  mbmp := TIEMultiBitmap.Create;
  mbmp.Read('input.tiff');
  mbmp.Write('output.tiff');
  mbmp.Free;
end;

Which is the same as...
with TIEMultiBitmap.Create('input.tiff') do
begin
  Write('output.tiff');
  Free;
end;

Also, the same as...
var
  mbmp: TIEMultiBitmap;
  mio: TImageEnMIO;
begin
  mbmp := TIEMultiBitmap.Create;
  mio := TImageEnMIO.CreateFromIEMBitmap(mbmp);
  mio.LoadFromFile('input.tiff');
  mio.SaveToFile('output.tiff');
  mio.Free;
  mbmp.Free;
end;