[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Loads graphic data from a resource identified by the integer identifier ResID.
Source position: graphics.pp line 838
public procedure TGraphic.LoadFromResourceID( |
Instance: TLCLHandle; |
ResID: PtrInt |
); virtual; |
Instance |
|
Handle where the content for the resource is stored. |
ResID |
|
Pointer to the Integer Resource ID for the resource. |
LoadFromResourceID is a procedure used to load a resource with the specified Resource ID into the class instance. Instance contains the Handle used to read the resource. LoadFromResourceName calls GetResourceType to get the Integer resource type used in the class instance. No actions are performed in the method when the TResourceType value is unassigned (contains Nil).
LoadFromResourceName creates a temporary TResourceStream that is used to load the content for the class instance by calling the LoadFromStream method. The value in ResID is located in the resource, and its resource handle is used to get the content stored in the stream.
An EResNotFound exception is raised during stream initialization if the resource type or the resource handle is invalid.
Use LoadFromResourceName to load a resource with a given resource name.
Use LoadFromLazarusResource to load a Lazarus resource from a .lrs file with a give name.
Raises an EResNotFound exception when the TResourceStream is initialized if the resource type or the resource handle is invalid.
Modified in LCL version 4.0 to use the TLCLHandle type instead of the deprecated THandle type in the Instance parameter.
|
Gets the Integer Resource Type for the class instance. |
|
|
Reads graphic data from a stream. |
|
|
Loads a resource with the specified name from the given handle. |
|
|
Load the graphic data from a Lazarus Resource (.lrs) file. |
|
|
The type used for handles in LCL applications, components, controls, and widget set classes. |
|
Version 4.0 | Generated 2025-05-03 | Home |