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

# LoadGlyphFromResourceName

Loads a bitmap from a named resource into the specified Glyph.

## Declaration

Source position: buttons.pp line 523

`procedure LoadGlyphFromResourceName(`
`AGlyph: TButtonGlyph;`
`Instance: TLCLHandle;`
`const AName: string`
`);`

## Arguments

`AGlyph` |  | Button glyph updated in the routine.
`Instance` |  | Handle for the resource.
`AName` |  | Resource name loaded in the routine.

## Description

LoadGlyphFromResourceName is a procedure used to load a bitmap into the specified Glyph from a named resource. AGlyph is the TButtonGlyph where the bitmap is stored. Instance is a TLCLHandle for the resource instance accessed in the routine. AName contains the name for the resource loaded in the routine.

LoadGlyphFromResourceName calls CreateBitmapFromResourceName to retrieve a TCustomBitmap using the specified handle and resource name. The bitmap is assigned to the TButtonGlyph in AGlyph. When AName is an empty string (''), the Glyph image in AGlyph is set to Nil.

LoadGlyphFromResourceName is used in the implementation of the LoadGlyphFromResourceName method in both TCustomBitBtn and TCustomSpeedButton.

## Version info

Modified in LCL version 4.0 to use the TLCLHandle type for the Instance argument instead of the deprecated THandle type.

## See also

TCustomBitBtn.LoadGlyphFromResourceName |  | Loads the Glyph image with the specified named from a resource instance.
TCustomSpeedButton.LoadGlyphFromResourceName |  | Loads the image for the Glyph with the specified name from a resource instance.
TButtonGlyph |  | Represents an image that can be attached to a button.
CreateBitmapFromResourceName
TLCLHandle |  | Alias to the TLCLHandle type defined for widgetset references.