SaveToStream(Stream: IIOStream);
Stream - stream, to which the image is saved.
The SaveToStream method saves image to the stream that is passed by the Stream parameter.
The file is saved in the initial format. To change the format, use the SaveToStreamEncoded method. Use the RawFormat property to check the format.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Image: IGxImage;
Strem1: IIOStream;
Begin
Strem1 := New MemoryStream.Create;
Image := ImageBox1.Image;
Image.SaveToStream(Strem1);
End Sub Button1OnClick;
After executing the example clicking the button saves the image that is stored in the component named ImageBox1 to the Stream stream.
See also: