[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Loads content from the specified resource into the Graphic property.
Source position: graphics.pp line 932
public procedure TPicture.LoadFromResourceName( |
Instance: THandle; |
const ResName: string |
); |
Instance: THandle; |
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 LoadFromStream 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).
Version 3.2 | Generated 2024-02-25 | Home |