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

CreateBitmapFromLazarusResource

Creates and loads a Bitmap from a Lazarus Resource (.lrs) file.

Declaration

Source position: graphics.pp line 1992

function CreateBitmapFromLazarusResource(

  const AName: string

):TCustomBitmap;

function CreateBitmapFromLazarusResource(

  const AName: string;

  AMinimumClass: TCustomBitmapClass

):TCustomBitmap;

function CreateBitmapFromLazarusResource(

  AHandle: TLResource

):TCustomBitmap;

function CreateBitmapFromLazarusResource(

  AHandle: TLResource;

  AMinimumClass: TCustomBitmapClass

):TCustomBitmap;

Arguments

AName

  

Name for the graphic resource loaded in the routine.

Function result

TCustomBitmap with the graphic content created in the routine.

Arguments

AName

  

Name for the graphic resource loaded in the routine.

AMinimumClass

  

Class type required to load the content for the specified resource. The default class type is TCustomBitmapClass.

Arguments

AHandle

  

Handle for the Lazarus resource accessed in the routine.

Arguments

AHandle

  

Handle for the Lazarus resource accessed in the routine.

AMinimumClass

  

Class type required to load the content for the specified resource. The default class type is TCustomBitmapClass.

Description

CreateBitmapFromLazarusResource is an overloaded TCustomBitmap function used to create and populate a bitmap with the content specified by the arguments to the routine.

The overloaded variants allow either a resource name (AName) or TLResource handle (AHandle) to be used to select the content for the bitmap. The variants with the AMinimumClass argument allow the class type for the graphic to be specified. TCustomBitmapClass is the default class type used in the overloaded variants.

CreateBitmapFromLazarusResource uses a temporary TLazarusResourceStream instance to load the content from the Lazarus resource.

CreateBitmapFromLazarusResource is used in the implementation of routines like LoadBitmapFromLazarusResourceHandle and GetDefaultGlyph (in ImgList.pp).

See also

TCustomBitmap

  

TCustomBitmap - the base class for TBitmap.

TCustomBitmapClass

  

Class reference used to create new instances of TCustomBitmap.

LoadBitmapFromLazarusResourceHandle

  

Deprecated - technically a bitmap is created, not loaded.

GetDefaultGlyph

  

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

TLazarusResourceStream

  

Helper class for streaming resources (read only).

TLResource

  

Describes a Lazarus resource stored in TLResourceList.


Version 4.0 Generated 2025-05-03 Home