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

# GetDefaultButtonIcon

Gets a scaled bitmap with the default glyph for the specified button identifier.

## Declaration

Source position: buttons.pp line 530

`function GetDefaultButtonIcon(`
`idButton: Integer;`
`ScalePercent: Integer = 100`
`):TCustomBitmap;`

## Arguments

`idButton` |  | Numeric button identifier used to retrieve the glyph from LCL resources.
`ScalePercent` |  | Scaling percentage for the glyph bitmap. The default value is 100.

## Function result

Default glyph bitmap for the specified button identifier.

## Description

GetDefaultButtonIcon is a TCustomBitmap function used to retrieve the default glyph bitmap for the button identifier in idButton. idButton contains one of the button identifiers defined in LCLType.pp, such as:

- idButtonOk (1)
- idButtonCancel (2)
- idButtonHelp (3)
- idButtonYes (4)
- idButtonNo (5)
- idButtonClose (6)
- idButtonAbort (7)
- idButtonRetry (8)
- idButtonIgnore (9)
- idButtonAll (10)
- idButtonYesToAll (11)
- idButtonNoToAll (12)
- idButtonOpen (13)
- idButtonSave (14)
- idButtonShield (15)

GetDefaultButtonIcon uses the value in idButton to get the resource name for the button from the BitBtnResNames constant. If a resource name is not found for the button identifier, the image data in the return value is empty.

ScalePercent contains the scaling percentage for the retrieved bitmap. The default value is 100 and keeps the original dimensions for the bitmap.

GetDefaultButtonIcon calls the GetDefaultGlyph routine to retrieve the scaled bitmap. The image is loaded from application or LCL resources with the required name and scaling percentage, and stored in the return value. Transparency is applied to the bitmap using the color in the bottom, left pixel if it is not already enabled. Please note that GetDefaultGlyph raises an exception if a resource with the required name and scaling percentage is not found in the available resources.

GetDefaultButtonIcon is called from the GetButtonIcon and GetLCLDefaultBtnGlyph routines, and occurs when a value other than bkCustom is assigned to the Kind property in TCustomBitBtn.

## See also

BitBtnResNames |  | Contains resource names for corresponding button identifiers in TBitBtn.
GetButtonIcon |  | Gets a bitmap with the glyph image for the specified button identifier.
GetLCLDefaultBtnGlyph |  | Gets the default LCL button glyph for the specified button Kind.
GetDefaultGlyph |  | Gets a glyph with the specified name from the default resource file.