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

# TCustomBitmap.SetHandles

Sets handles for the bitmap and the mask to the specified values.

## Declaration

Source position: graphics.pp line 1427

`public procedure TCustomBitmap.SetHandles(`
`ABitmap: HBITMAP;`
`AMask: HBITMAP`
`); override;`

## Arguments

`ABitmap` |  | New Bitmap handle for the image.
`AMask` |  | New Mask handle for the image.

## Description

SetHandles is a procedure used to set the handles for the bitmap and the mask to the values specified in ABitmap and AMask. SetHandles ensures that the Canvas context, shared image, and save stream are unshared and freed. SetHandles calls UpdateHandles to store the specified handles for the shared image and its mask.

SetHandles is called from methods that load image data using TLazIntfImage from the LCL interface. It is also called when values are assigned to the BitmapHandle or MaskHandle properties.

## See also

TRasterImage.SetHandles |  | Sets handles for the bitmap and the mask to the specified values.