Sign in Join
FPDoc Onlineexperiment

GraphicExtension function

In unit Graphics

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

Declaration

pascal
function GraphicExtension(GraphicClass: TGraphicClass): string

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.

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.