TRasterImage.ReadData procedure
Reads image data during component streaming.
Declaration
procedure ReadData(Stream: TStream); overrideDescription
ReadData is a procedure used to read binary data for the graphic
from the specified stream. It is used by the
TFiler instance which loads data during component streaming. It is
overridden in TRasterImage to provide support for TRasterImageClass and
descendants when loading raw image data.
Versions of Lazarus prior to 0.9.26 did not maintain a relationship between graphics formats and image class types. ReadData checks the LongInt value at the beginning of the stream to determine the version number for the streaming format. When a newer version is used, the signature for the image format is read from the Stream. If the image class used is not derived from the TRasterImageClass type, additional conversion is needed to load the raw image data and assign the values to the class instance.
ReadData calls LoadFromStream to complete the operation.
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
