Creates and loads a TGraphic instance with the content from the specified resource instance handle and resource name.
Source position: graphics.pp line 1990
function CreateGraphicFromResourceName( |
Instance: TLCLHandle; |
const ResName: string |
):TGraphic; |
Instance |
|
TLCLHandle instance for the application resource accessed in the routine. |
ResName |
|
Name for the resource loaded from the specified resource handle. |
TGraphic (or descendant) instance with the graphic content loaded for the specified resource.
CreateGraphicFromResourceName calls the RTL FindResource routine to get an FPC resource handle for the LCL handle in Instance and the resource with the name in ResName.
Both Icon and Cursor group resource types are checked using FindResource. When a valid resource handle (one with a non-zero value) is available, a TIcon or TCursorImage instance is created and used as the return value for the routine. The LoadFromResourceHandle method in the class instance is called to load the image content for the resource.
If a handle is not found for an Icon or a Cursor resource type, the CreateBitmapFromResourceName routine is called to create and load the content in the TGraphic instance.
CreateGraphicFromResourceName is used in the implementation of the TCustomImageList.AddResourceName method.
Modified in LCL version 4.0 to use the TLCLHandle type instead of the deprecated THandle type in the Instance parameter.
|
Abstract base class used for images in supported image formats. |
|
|
Loads icon data from the specified instance and resource handles. |
|
|
Loads cursor images from the specified instance and resource handles. |
|
|
Adds a graphic from a resource with the specified resource name. |
|
|
The type used for handles in LCL applications, components, controls, and widget set classes. |
Lazarus Component Library (LCL) | Version 3.99-1b97b99691 (2024-09-01) | Home |