TRasterImage.SaveToStream procedure
Saves image data to the specified stream.
Declaration
procedure SaveToStream(AStream: TStream); overrideDescription
SaveToStream is an overridden method used to write image data to
the stream specified in
AStream.
SaveToStream calls SaveStreamNeeded to ensure that an internal
save stream exists in the class instance. An
EInvalidGraphicOperation exception is raised in SaveStreamNeeded
when the active update count for the count is not 0 (zero). An
FPImageException is raised when a TMemoryStream instance could not
be created and initialized in SaveStreamNeeded.
SaveToStream resets the internal save to stream to its origin, and resizes
AStream to include sufficient storage for the values in the internal save
stream. The CopyFrom method in AStream is called to store the
content for the internal shared image. An FPImageException is
raised when the number of bytes written in the CopyFrom method does not match
the size for the internal save stream.
Errors
Raises an FPImageException exception when the number of bytes written to the stream does not match the size for the raw image data.
An Exception may be raised in SaveToStream (called in the method).
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
