SaveToStream

Parent Previous Next

Procedure SaveToStream(AStream : TStream) - Public

Call SaveToStream to copy the layer structure to AStream. Only the layers are copied, not the component itself.

This is how to copy the content of one ImagePainter to another:

var
 MyStream : TMemoryStream;
begin
 MyStream := TMemoryStream.Create;
 try
    ImagePainter1.SaveToStream(MyStream);
    ImagePainter2.LoadFromStream(MyStream);
 finally
  MyStream.Free;
 end;
end;

Note
If you save the stream to a file, you should use the IPD extension, else you will get problems when reading it back with the LoadFromFile procedure.

See also
LoadFromStream procedure