ImageEn, unit imageenio

TImageEnIO.SaveToStream

TImageEnIO.SaveToStream


Declaration

procedure SaveToStream(Stream: TStream; FileType: TIOFileType);


Description

SaveToStream saves the image to a stream. You must specify the file format (if ioUnknown is specified, the current file type is used).

If StreamHeaders property is True, an additional special header is added, which is needed for multi-image streams.

Note: To abort while saving, set Aborting to true


Examples

// Show how image in ImageEnView1 will look if saved to JPEG at a specified quality
ms := TMemoryStream.Create();
ImageEnView1.IO.Params.JPEG_Quality := SpinEdit1.value;
ImageEnView1.IO.SaveToStream( ms, fmt );
ms.Position := 0;
ImageEnView2.IO.LoadFromStream( ms, fmt );
ms.Free();

// Output current image to a TImage
Stream := TMemoryStream.Create();
ImageEnView1.IO.SaveToStream( Stream, ioBMP );
Stream.Position := 0;
Image1.Picture.LoadFromStream( Stream );
Stream.Free();