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

# TCustomIcon.Assign

Copies values from the specified persistent object into the current class instance.

## Declaration

Source position: graphics.pp line 1654

`public procedure TCustomIcon.Assign(`
`Source: TPersistent`
`); override;`

## Arguments

`Source` |  | Persistent object with values copied into the current class instance.

## Description

Assign is an overridden method used to copy values from the persistent object in Source into the current class instance. Assign calls BeginUpdate to increment the active update counter, and calls EndUpdate prior to exiting from the method.

Assign handles specific class types in Source, including:

TRasterImage
  Calls Clear to remove existing image content, and calls Add to create and icon image with the attributes in the PixelFormat, Height, and Width properties in Source. Calls AssignImage to store the image content from Source in the icon image. If the shared image class in Source is different than the one for the current class instance, UnshareImage is called.
TCustomIcon
  Sets the value in Current to the value found in Source.

When Source is derived from another class type, the inherited Assign method is called.

## See also

TRasterImage.Assign |  | Assign - copies details from Source according to data type.
TPersistent.Assign