Scales an image and its optional mask to the specified target size.
Source position: imglist.pp line 325
public class procedure TCustomImageList.ScaleImage( |
const ABitmap: TCustomBitmap; |
const AMask: TCustomBitmap; |
TargetWidth: Integer; |
TargetHeight: Integer; |
var AData: TRGBAQuadArray |
); |
const ABitmap: TCustomBitmap; |
const AMask: TCustomBitmap; |
SourceRect: TRect; |
TargetWidth: Integer; |
TargetHeight: Integer; |
var AData: TRGBAQuadArray |
); |
const ABitmap: HBITMAP; |
const AMask: HBITMAP; |
SourceRect: TRect; |
TargetWidth: Integer; |
TargetHeight: Integer; |
var AData: TRGBAQuadArray |
); |
ABitmap |
|
Bitmap with the image scaled in the method. |
AMask |
|
Optional mask that defines the transparent areas of the image. |
TargetWidth |
|
Target width for the scaled image. |
TargetHeight |
|
Target Height for the scaled image. |
AData |
|
32-bit RGBA raw image data for the scaled image. |
ABitmap |
|
Bitmap with the image scaled in the method. |
AMask |
|
Optional mask that defines the transparent areas of the image. |
SourceRect |
|
Defines the area in the original image scaled in the method. |
TargetWidth |
|
Target width for the scaled image. |
TargetHeight |
|
Target Height for the scaled image. |
AData |
|
32-bit RGBA raw image data for the scaled image. |
ABitmap |
|
Bitmap with the image scaled in the method. |
AMask |
|
Optional mask that defines the transparent areas of the image. |
SourceRect |
|
Defines the area in the original image scaled in the method. |
TargetWidth |
|
Target width for the scaled image. |
TargetHeight |
|
Target Height for the scaled image. |
AData |
|
32-bit RGBA raw image data for the scaled image. |
ScaleImage is an overloaded class procedure used to scale an image and its optional mask to the specified target size.
ABitmap is the TCustomBitmap with the original image scaled in the method.
AMask is the optional mask that defines the transparent areas in ABitmap. When AMask is a valid TCustomBitmap instance, the handle to its bitmap is used in the scaling operation. When AMask has not been assigned (contains Nil), the handle to the mask in ABitmap is used for the transparent areas in the image.
TargetWidth and TargetHeight contain the size requested for the scaled image.
AData is a variable TRGBAQuadArray parameter where the 32-bit RGBA raw image data for the scaled image is stored.
An overloaded variant of the method provides the SourceRect parameter which defines the area in ABitmap that is scaled in the method.
ScaleImage sets the size of AData to the number of bytes needed for the target image size (TargetHeight * TargetWidth * 32).
ScaleImage tries to load a bitmap that uses the image and mask specified in ABitmap and AMask. If they cannot be combined and loaded, no additional actions are performed in method. If they are loaded successfully, their pixel data is examined and used to set the alpha channel and transparency for each pixel. The adjusted image is rendered for the target image size using TFPImageCanvas. The pixel data for the rendered image is stored in AData using the RGBA attributes for the scaled image.
ScaleImage is used in the implementation of several methods, including:
|
Adds images with varying sizes to the corresponding image resolution. |
|
|
Adds a portion of an image to each of the resolutions in the image list. |
|
|
Adds images to the image list from image data stored as adjacent columns and rows. |
|
|
Inserts an image into each image resolution at the specified position. |
|
|
Inserts an Icon into each of the resolutions for the image list. |
|
|
Inserts a transparent image into the image resolutions at the specified position. |
|
|
Replaces an image at the specified position with the given bitmap. |
|
|
Replaces the icon at the specified position in all resolutions for the image list. |
|
|
Replaces the image at the specified position with a masked image. |
|
Lazarus Component Library (LCL) | Version 3.99-1b97b99691 (2024-09-01) | Home |