Skip to main content
Table of Contents

TTMSFNCUtils.GetImageType Method

Detects the image file extension represented by stream header bytes.

API unit family: TMSFNCUtils Declaring type: TTMSFNCUtils

Overloads

Overload 1

Detects the image file extension represented by stream header bytes.

FMX.TMSFNCUtils.hppPascalC++
class function GetImageType(AData: TStream; AResetPosition: Boolean = True): string; overload;
__classmethod System::UnicodeString __fastcall GetImageType(System::Classes::TStream* AData, bool AResetPosition = true)/* overload */;

Parameters

Name Description
AData Stream containing image data.
AResetPosition When True, reads from the beginning of the stream; the original position is restored afterward.

Returns

Detected extension such as .png, .jpg, or an empty string when no known header is found.

Overload 2

Detects the image file extension represented by a bitmap.

FMX.TMSFNCUtils.hppPascalC++
class function GetImageType(ABitmap: TTMSFNCBitmap; AResetPosition: Boolean = True): string; overload;
__classmethod System::UnicodeString __fastcall GetImageType(TTMSFNCBitmap* ABitmap, bool AResetPosition = true)/* overload */;

Parameters

Name Description
ABitmap Bitmap to inspect.
AResetPosition Reserved for overload compatibility.

Returns

Detected extension such as .png, .jpg, or an empty string when no known header is found.