[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 1664

`public procedure TCustomIcon.LoadFromResourceID(`
`Instance: TLCLHandle;`
`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 info

Modified in LCL version 4.0 to use the TLCLHandle type instead of the deprecated THandle type in the Instance parameter.

## See also

LCLType.TLCLHandle |  | Alias to the TLCLHandle type defined for widgetset references.
WSReferences.TLCLHandle |  | The type used for handles in LCL applications, components, controls, and widget set classes.