Sign in Join
FPDoc Onlineexperiment

TCustomIcon.SetHandle procedure

Member of TCustomIconprotectedIn unit Graphics

Unshares an existing shared image handle and set the new value.

Declaration

pascal
procedure SetHandle(AValue: TLCLHandle); override

Arguments

AValue

New value for the shared image handle in the icon.

Description

SetHandle is a method used to set set the value for the shared image handle in the icon instance. It ensures that an existing shared image handle frees both its canvas context and the data in its TSharedImage instance.

It calls UpdateHandle to set the new shared handle for the icon instance to AValue. Values in Current and Count are reset when the handle is changed. Current is set 0 when multiple images are used in the icon. It is set to -1 when a single image is present. Changed is called to update the value in Modified and signal the OnChange event handler (when assigned).

Modified in LCL version 4.0 to use the TLCLHandle type instead of the deprecated THandle type in the AValue parameter.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.