Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxSmartImageCodecsRepository.GetFormatByExt(string) Method

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

#Declaration

Delphi
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