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

# TRasterImage.SetHandle

Sets the handle used for the image.

## Declaration

Source position: graphics.pp line 1295

`protected procedure TRasterImage.SetHandle(`
`AValue: TLCLHandle`
`); virtual;`

## Arguments

`AValue` |  | New value for the Handle.

## Description

SetHandle stores the specified TLCLHandle value as the handle used for the image. The handle is actually the one used by the internal TSharedRasterImage instance for the class. No actions are performed in the method when the value in AHandle is the same as the handle in the shared image instance.

SetHandle frees the device context for the bitmap Canvas, unshares the shared image, and discards its image data. The handle in AValue is assigned to the internal shared image. When no other active update processes are pending, the Changed method is called.

## Version info

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

## See also

TRasterImage.Changed |  | Changed - method to call when properties have changed.
TRasterImage.Canvas |  | The Canvas where the raster image is rendered.
TRasterImage.BeginUpdate |  | BeginUpdate - start the update process.
TRasterImage.EndUpdate |  | EndUpdate - finishes the update process.
TRasterImage.SetHandles |  | Sets handles for the bitmap and the mask to the specified values.
TSharedImage.Reference |  | Increases the reference count.
LCLType.TLCLHandle |  | Alias to the TLCLHandle type defined for widgetset references.
WSReferences.TLCLHandle |  | The type used for handles in LCL applications, components, controls, and widget set classes.