Adds a graphic from a resource with the specified resource name.
Source position: imglist.pp line 352
public function TCustomImageList.AddResourceName( |
Instance: TLCLHandle; |
const ResourceName: string; |
MaskColor: TColor = clNone |
):Integer; |
Instance |
|
Handle for the resource. |
ResourceName |
|
Name of the resource loaded in the method. |
MaskColor |
|
Color for transparent areas in the image, clNone for an opaque image. |
Ordinal position where the image was stored.
AddResourceName is an Integer function used to load and store a TGraphic for the specified resource name.
Instance is a TLCLHandle value with the handle for the resource where an image is stored.
ResourceName is a String value that contains the name for the resource loaded in the method.
MaskColor is a TColor value used transparent areas in the graphic. The default value for the property is clNone, and indicates the graphic is rendered as an opaque (solid) image.
AddResourceName calls the CreateGraphicFromResourceName routine to get the image for the resource name specified in ResourceName. The return value may be either a TGraphic or a TCustomBitmap class instance.
When the image is a TCustomBitmap, the value in MaskColor is stored in the bitmap and transparency is enabled when the color is not clNone. MaskColor is not used when the return value is a TGraphic instance; TGraphic does not support transparency.
AddResourceName calls the appropriate method to store the image type in the image list. When TCustomBitmap is used, the Add method is called. When TGraphic is used, the AddIcon method is called. The return value contains the ordinal position in the image list where the image was stored.
Modified in LCL version 4.0 to use the TLCLHandle type instead of the deprecated THandle type in the Instance parameter.
|
Adds an image to the list using its source data and optional mask. |
|
|
Adds an icon to the image list. |
|
|
Creates and loads a TGraphic instance with the content from the specified resource instance handle and 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 |