[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Graphics' (#lcl)

TCustomIcon.LoadFromResourceID

Load icon data from a resource with the specified integer resource identifier.

Declaration

Source position: graphics.pp line 1668

public procedure TCustomIcon.LoadFromResourceID(

  Instance: THandle;

  ResID: PtrInt

); override;

Arguments

Instance

  

Handle where the content for the resource is stored.

ResID

  

Integer resource identifier loaded in the method.

Description

LoadFromResourceID is an overridden procedure used to load a resource with the specified Resource ID into the class instance. LoadFromResourceID re-implements the method defined in the ancestor class, and does not call the inherited method.

Instance contains the Handle used to read the resource. ResID contains an Integer pointer to the resource identifier loaded in the method.

LoadFromResourceID 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 ID and type is not found in FindResource.

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

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.

Errors

Raises an EResNotFound exception if the resource handle for the specified ID and type is not valid.


Version 3.2 Generated 2024-02-25 Home