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

# GraphicExtension

Gets a string with the file extension used for the specified graphic class type.

## Declaration

Source position: graphics.pp line 1919

`function GraphicExtension(`
`GraphicClass: TGraphicClass`
`):string;`

## Arguments

`GraphicClass` |  | Graphic class used to determine the file extension.

## Function result

File extension for the image type.

## Description

Calls GetPicFileFormats to get the list which maps TGraphicClass (or descendent) references to a file extension.

GraphicExtension iterates over the values in the mapping list in reverse order, and compares the class name for the list item to the class name in GraphicClass. When a match is found, the GetFormatExt method for the item is called to get the return value for the function.

The return value is an empty string ('') when a mapping for GraphicClass is not found in the list.