Sign in Join
FPDoc Onlineexperiment

TCustomIcon.LoadFromResourceName procedure

Member of TCustomIconpublicIn unit Graphics

Loads the icon with the specified resource name from the instance handle.

Declaration

pascal
procedure LoadFromResourceName(Instance: TLCLHandle; 
 const ResName: string); override

Arguments

Instance

Handle where the content for the resource is stored.

ResName

Name for the resource loaded in the method.

Description

LoadFromResourceName is an overridden procedure used to load a resource with the name specified in ResName using the handle provided in Instance. LoadFromResourceName re-implements the method defined in the ancestor class, and does not call the inherited method.

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 calls FindResource to get the resource handle needed in the method. An EResNotFound exception is raised if a resource with the specified name and type is not found in FindResource.

LoadFromResourceName calls LoadFromResourceHandle to load the icon using the Instance and resource handle values.

Use LoadFromResourceID to load a resource by its Resource ID.

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.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.