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.
class function ConvertBitmapToJPEGStream(ABitmap: TTMSFNCBitmapHelperClass; AQuality: Single = 1.0; ABackgroundColor: TColor = clWhite): TMemoryStream;
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.
class function ConvertBitmapToJPEGStream(ABitmap: TTMSFNCBitmapHelperClass; AQuality: Single = 1.0; ABackgroundColor: TAlphaColor = TAlphaColorRec.White): TMemoryStream;
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.
class function ConvertBitmapToJPEGStream(ABitmap: TTMSFNCBitmapHelperClass; AQuality: Single = 1.0; ABackgroundColor: TColor = clWhite): TMemoryStream;
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.