Skip to main content

TdxSmartImageCodecsRepository.GetFormatByExt(string) Method

Returns a registered class-reference to an image codec by a filename extension associated with the codec’s format.

Declaration

class function GetFormatByExt(const Ext: string): TdxSmartImageCodecClass;

Parameters

Name Type
Ext string

Returns

Type
TdxSmartImageCodecClass

Remarks

Call this class function and pass a filename extension as the Ext parameter to access the corresponding image codec class via its class-reference. The function iterates through all registered codecs and calls the Extensions class function for each codec to compare results to the specified extension until the first match. If the GetFormatByExt function finds no match, it returns nil instead of a reference to an image codec class.

A Smart Image container’s SaveToFile procedure calls this class function internally to identify the target image codec by the specified filename’s extension.

See Also