TRasterImage.Assign procedure
Assign - copies details from Source according to data type.Declaration
procedure Assign(Source: TPersistent); overrideArguments
Source | Persistent object with values copied in the method. |
Description
Assign is a procedure used to copy values from the specified
TPersistent object into the current class instance. Assign is
overridden to handle using a
TRasterImage or
TFPCustomImage instance in the
Source parameter.
No actions are performed in the method when Source is the same class instance as the current class instance (Self).
When Source is a TRasterImage instance, the following actions are performed:
- Clears an allocated mask handle by calling UpdateHandles.
- Sets TransparentMode, TransparentColor, and Masked to the values in Source.
- Frees an existing Canvas context when shared images are not the same.
- Makes a copy of the shared image in Source when they are of the same image class.
- Creates a new shared image and copies its raw image data when they are NOT of the same image class.
- Copies an allocated mask handle from Source.
- Calls Changed to update Modified and signal the OnChange event handler (when assigned).
When Source is a TFPCustomImage instance, the following actions are performed:
- Copies the raw image data from Source using its bitmap and mask handles.
- Calls UpdateHandles to reflect the new handles in the current class instance.
- Calls Changed to update Modified and signal the OnChange event handler (when assigned).
For other TPersistent descendants, the inherited method is called using Source as an argument.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
