[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Loads content from the specified resource into the Graphic property.
Source position: graphics.pp line 918
public procedure TPicture.LoadFromResourceName( |
Instance: TLCLHandle; |
const ResName: string |
); |
Instance: TLCLHandle; |
const ResName: string; |
AClass: TGraphicClass |
); |
Instance |
|
Handle with the resources examine in the method. |
ResName |
|
Name of the resource loaded in the method. |
Instance |
|
Handle with the resources examine in the method. |
ResName |
|
Name of the resource loaded in the method. |
AClass |
|
TGraphic descendant for the image format. |
LoadFromResourceName is an overloaded method used to created a TGraphic instance with the content from the specified resource name. Instance is the handle with the resources examined in the method. ResName is the name of the resource loaded in the method.
LoadFromResourceName creates a new TGraphic class instance that is used as the member variable for the Graphics property. The CreateGraphicFromResourceName routine is called to create the graphic and load the named resource from the handle. The Changed method is assigned to the OnChange event handler in the class instance.
An overloaded variant includes an AClass argument with the class type for the TGraphic descendant needed for a supported image format. The LoadFromResourceName method in the class instance is called to load the named resource.
The existing TGraphic instance in Graphic is freed and the new TGraphic instance is used as the member variable. The Changed method is called to signal the OnChange event handler (when assigned).
Modified in LCL version 4.0 to use the TLCLHandle type instead of the deprecated THandle type in the Instance parameter.
|
Performs actions needed when value(s) in the class instance have been modified. |
|
|
Event handler signalled when data in the class instance is changed. |
|
|
Loads a resource with the specified name from the given handle. |
|
|
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. |
Version 4.0 | Generated 2025-05-03 | Home |