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

# TCustomBitmap.CreateDefaultBitmapHandle

Creates a handle for the bitmap using the bitmap handle type in the bitmap image data.

## Declaration

Source position: graphics.pp line 1397

`protected function TCustomBitmap.CreateDefaultBitmapHandle(`
`const ADesc: TRawImageDescription`
`):HBITMAP; override;`

## Arguments

`ADesc` |  | Device description information for the bitmap.

## Function result

Default handle for the bitmap.

## Description

CreateDefaultBitmapHandle is an overridden method in TCustomBitmap used to get the default bitmap handle needed to represent the image. The device description information in ADesc is used to determine the bit depth for the image data.

For DDB (Device-Dependent Bitmaps), the CreateBitmap routine is called to get the handle used as the return value.

For DIB (Device-Independent Bitmaps), the CreateDIBSection routine is called to get the handle. For platforms where CreateDIBSection is not implemented, the CreateBitmap routine is used as the fallback.

CreateDefaultBitmapHandle is called from the BitmapHandleNeeded method in the ancestor class.

## See also

TRasterImage.CreateDefaultBitmapHandle |  | Gets the default value for the Bitmap handle used in the class instance.