[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Graphics' (#lcl)

# TFPImageBitmap.ReadStream

Read the image data from the specified Stream.

## Declaration

Source position: graphics.pp line 1449

`protected procedure TFPImageBitmap.ReadStream(`
`AStream: TMemoryStream;`
`ASize: LongInt`
`); override;`

## Arguments

`AStream` |  | TMemoryStream instance with the image data read in the method.
`ASize` |  | Not used in the current implementation.

## Description

ReadStream is an overridden method used to read the image data from the stream specified in AStream.

ReadStream creates an instance of the TFPCustomImageReader class used to read the image type from a stream. It calls InitializeReader to configure the reader class instance. If the image reader class supports the ILazImageReader interface, it is configure to update its description from the image data. Otherwise, the GetDescriptionFromDevice routine is called to store the defaults for the LCL interface image.

ReadStream calls the ImageRead method in the TFPCustomImageReader instance to load the image data from AStream. FinalizeReader is called when the operation is completed. The shared image for the image type is freed, and the raw image data from the LCL interface image is loaded into the shared image. The mask information in raw image data is applied to the shared image. The image is flagged to update the value for the PixelFormat property in the calling routine.

## See also

TRasterImage.ReadStream |  | ReadStream - loads image data into the raw image.