Sign in Join
FPDoc Onlineexperiment

TRasterImage.BitmapHandleNeeded procedure

Member of TRasterImageprotectedIn unit Graphics

Ensures that handles for the image and mask are valid for the raw image data.

Declaration

pascal
procedure BitmapHandleNeeded; virtual

Description

BitmapHandleNeeded is a procedure used to ensures that handles for both the image and its mask are valid for the RawImage data. No actions are performed in the method when BitmapHandleAllocated returns True, or when RawImage data does not exist.

The MaskHandle is not created when:

  • A mask handle already exists.
  • The mask is created using the transparent color for the image.
  • Mask values do not exist in the raw image data.

BitmapHandleNeeded calls CreateCompatibleBitmaps to get the handles for the bitmap and mask using a pointer to the raw image data, and creates a default handle if CreateCompatibleBitmaps is unsuccessful. UpdateHandles is called to assign the new handles to BitmapHandle and MaskHandle (when used).

BitmapHandleNeeded is called from the Draw method prior to performing operations using the Canvas for the class instance. It is also used when the Canvas creates a new DC (Device Context).

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