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

# TCustomIcon.WriteStream

Writes the content for the multi-image icon to the specified stream.

## Declaration

Source position: graphics.pp line 1649

`protected procedure TCustomIcon.WriteStream(`
`AStream: TMemoryStream`
`); override;`

## Arguments

`AStream` |  | TMemoryStream instance where icon data is stored.

## Description

WriteStream is an overridden method used to write the content for the multi-image icon to the stream specified in AStream. WriteStream implements the abstract virtual method defined in the ancestor class.

WriteStream performs actions needed to write the header, icon directory, and content for each of the images used in the multi-image icon to the TMemoryStream instance. It handles both PNG and DIB Bitmap icon images, and creates Mask data for images when it is not already present.

For icon images used in TCursorImage, the X and Y coordinates for the HotSpot are also included in the image data.

WriteStream is called from SaveStreamNeeded when the SaveToStream method is performed.

## See also

TRasterImage.WriteStream |  | Writes the image content to the specified stream instance.