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

# TCustomImageList.ReadAdvData

Reads the image content for multiple resolutions from a stream.

## Declaration

Source position: imglist.pp line 337

`public procedure TCustomImageList.ReadAdvData(`
`AStream: TStream`
`); virtual;`

## Arguments

`AStream` |  | Stream with the image resolutions loaded in the method.

## Description

ReadAdvData is a procedure used to read the content for multiple image resolutions from the stream specified in AStream. ReadAdvData is the complement to the WriteAdvData method, and handles reading multiple image resolutions for the image list.

ReadAdvData calls BeginUpdate to block OnChange notifications in the method. The EndUpdate method is called when all image resolutions in the stream have been loaded.

ReadAdvData reads the image list signature from AStream, and checks the value to ensure that it supports use of BitmapAdv in its properties. If it does not contain the value SIG_LAZ3, an Exception is raised.

ReadAdvData reads the Integer value that indicates the number of image resolutions stored in the stream, and processes each resolution by reading the following values:

Value | Size
Resolution signature | SizeOf(TImageListSignature)
Image count | Cardinal
Image width | Cardinal
Image height | Cardinal

An exception is raised if an image resolution does not support BitmapAdv in its properties (requires SIG_LAZ3 or SIG_LAZ4 in the resolution signature).

ReadAdvData gets a TCustomImageListResolution instance from the internal TCustomImageListResolutions container that uses the image width for each of the resolutions. An image resolution is created if it does not already exist. Each resolution class instance calls its ReadData method to load image data from the stream in AStream.

ReadAdvData updates the internal Changed member for the image list, and calls Change prior to exiting from the method.

## Errors

Raises an exception if the image list signature is not SIG_LAZ3.

Raises an exception if an image resolution signature is not SIG_LAZ3 or SIG_LAZ4.

## See also

TCustomImageList.BeginUpdate |  | Starts an update to the image list, and controls execution of the OnChange event.
TCustomImageList.EndUpdate |  | Finishes an update to the image list, and calls Change.
TCustomImageList.Change |  | Sends change notifications when the image list is updated.
TCustomImageList.OnChange |  | Event handler signalled when the image list is changed.
TCustomImageList.Resolutions |  | Provides access to the image resolutions (or sizes) used in the image lists.
ReadLRSCardinal |  |