[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'ImgList' (#lcl)

GetDefaultGlyph

Gets a glyph with the specified name from the default resource file.

Declaration

Source position: imglist.pp line 473

function GetDefaultGlyph(

  ResourceName: string;

  ScalePercent: Integer = 100;

  IgnoreMissingResource: Boolean = False

):TCustomBitmap;

Arguments

ResourceName

  

Resource name for the glyph

ScalePercent

  

Scaling level for the bitmap image.

IgnoreMissingResource

  

Indicates if a missing resource can be ignored.

Function result

Bitmap for the requested resource name and scaling level.

Description

GetDefaultGlyph is a TCustomBitmap function used to get a glyph with the specified name from the default resource file.

ResourceName contains the name for the resource to locate in the resource file.

ScalePercent contains the scaling level requested for the glyph, and may be used as the suffix for the resource name. ScalePercent generally contains a value like 100, 150 or 200. When its value is not 100, it is appended to the resource name in the format: paste_150 or copy_200.

IgnoreMissingResource indicates if a missing resource can be silently ignored in the routine. When IgnoreMissingResource contains False, a missing resource causes an EResNotFound exception to be raised.

The return value contains the bitmap for the requested glyph. It is created by calling CreateBitmapFromResourceName routine. If no resource file is assigned for the current instance handle (HINSTANCE), the Lazarus resource file is searched as well. When a valid TBitmap image is found, its Transparent is updated to use the pixel at the bottom-left of the image as the fixed transparency color. The return value is Nil when a resource with the requested name and scaling level is not found.

GetDefaultGlyph is used in the implementation of the TLCLGlyphs.GetImageIndex method.

Errors

Raises an EResNotFound exception for a missing resource when IgnoreMissingResource contains False. Raised with the message in SResNotFound.

See also

TLCLGlyphs.GetImageIndex

  

Gets the position of the specified resource.


Version 3.2 Generated 2024-02-25 Home