TGraphic.LoadFromResourceID procedure
Loads graphic data from a resource identified by the integer identifier
ResID.
Declaration
procedure LoadFromResourceID(Instance: TLCLHandle; ResID: PtrInt)
; virtualArguments
Instance | Handle where the content for the resource is stored. |
ResID | Pointer to the Integer Resource ID for the resource. |
Description
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.
Modified in LCL version 4.0 to use the TLCLHandle type instead of the deprecated THandle type in the Instance parameter.
Errors
Raises an EResNotFound exception when the TResourceStream is initialized if the resource type or the resource handle is invalid.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
