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

# TGraphic.LoadFromResourceName

Loads a resource with the specified name from the given handle.

## Declaration

Source position: graphics.pp line 837

`public procedure TGraphic.LoadFromResourceName(`
`Instance: TLCLHandle;`
`const ResName: string`
`); virtual;`

## Arguments

`Instance` |  | Handle where the content for the resource is stored.
`ResName` |  | Name for the resource loaded in the method.

## Description

LoadFromResourceName is a procedure used to load a resource with the name specified in ResName using the handle provided in Instance. 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.

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.

## 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

TGraphic.GetResourceType |  | Gets the Integer Resource Type for the class instance.
TGraphic.LoadFromStream |  | Reads graphic data from a stream.
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.
TResourceStream