Skip to main content
Table of Contents

TTMSFNCUtils.ConvertBitmapToJPEGStream Method

Converts a bitmap to a JPEG stream using the common graphics color type.

API unit family: TMSFNCUtils Declaring type: TTMSFNCUtils

Overloads

Overload 1

Converts a bitmap to a JPEG stream using the common graphics color type.

FMX.TMSFNCUtils.hppPascalC++
class function ConvertBitmapToJPEGStream(ABitmap: TTMSFNCBitmapHelperClass; AQuality: Single = 1.0; ABackgroundColor: TColor = clWhite): TMemoryStream;
__classmethod System::Classes::TMemoryStream* __fastcall ConvertBitmapToJPEGStream(TTMSFNCBitmapHelperClass* ABitmap, float AQuality = 1.000000E+00f, System::Uitypes::TAlphaColor ABackgroundColor = (System::Uitypes::TAlphaColor)(0xffffffff));

Parameters

Name Description
ABitmap Bitmap to convert.
AQuality JPEG quality from 0 to 1; defaults to 1.
ABackgroundColor Background color used behind transparent pixels.

Returns

Memory stream containing JPEG data, or nil when conversion fails. The caller is responsible for freeing it.

Overload 2

Converts a bitmap to a JPEG stream using the alpha color type.

FMX.TMSFNCUtils.hppPascalC++
class function ConvertBitmapToJPEGStream(ABitmap: TTMSFNCBitmapHelperClass; AQuality: Single = 1.0; ABackgroundColor: TAlphaColor = TAlphaColorRec.White): TMemoryStream;
__classmethod System::Classes::TMemoryStream* __fastcall ConvertBitmapToJPEGStream(TTMSFNCBitmapHelperClass* ABitmap, float AQuality = 1.000000E+00f, System::Uitypes::TAlphaColor ABackgroundColor = (System::Uitypes::TAlphaColor)(0xffffffff));

Parameters

Name Description
ABitmap Bitmap to convert.
AQuality JPEG quality from 0 to 1; defaults to 1.
ABackgroundColor Background color used behind transparent pixels.

Returns

Memory stream containing JPEG data, or nil when conversion fails. The caller is responsible for freeing it.

Overload 3

Converts a bitmap to a JPEG stream when supported by the web runtime.

FMX.TMSFNCUtils.hppPascalC++
class function ConvertBitmapToJPEGStream(ABitmap: TTMSFNCBitmapHelperClass; AQuality: Single = 1.0; ABackgroundColor: TColor = clWhite): TMemoryStream;
__classmethod System::Classes::TMemoryStream* __fastcall ConvertBitmapToJPEGStream(TTMSFNCBitmapHelperClass* ABitmap, float AQuality = 1.000000E+00f, System::Uitypes::TAlphaColor ABackgroundColor = (System::Uitypes::TAlphaColor)(0xffffffff));

Parameters

Name Description
ABitmap Bitmap to convert.
AQuality JPEG quality from 0 to 1; defaults to 1.
ABackgroundColor Background color used behind transparent pixels.

Returns

Memory stream containing JPEG data, or nil when conversion is not supported.