ImageEn, unit iexHelperFunctions




procedure IEConvertToThumbnail(iMaxX, iMaxY: integer;
                               bCanStretch: Boolean;
                               QualityFilter : TResampleFilter = rfLanczos3;

                               bAddBorder: Boolean = False;
                               cBorderColor: TColor = clBlack;

                               bAddShadow: Boolean = False;
                               iBlurRadius : Integer = 4;
                               iShadowOffset : Integer = 4;
                               cShadowColor: TColor = clBlack;
                               cBGColor: TColor = clWhite);


Resize an image in a TBitmap to the specified size (while maintaining the aspect ratio, thus one of the dimensions is likely to be less than the specified value).

Parameter Description
iMaxX, iMaxY The maximum size of the new image (as the aspect ratio is maintained, one of the dimensions is likely to be less than the specified value)
bCanStretch Set to false to avoid images smaller than iMaxX x iMaxY from being made larger
bAutoAdjustOrientation Sets EnableAdjustOrientation to automatically re-orient JPEG camera images
QualityFilter Specify the quality that is used for rescaling the image
bAddBorder Set to true to add a 1 pixel border to the thumbnail
cBorderColor The color of the added border
bAddShadow Add a solid or soft shadow to the image
iBlurRadius Set to 0 to add a solid shadow or any other value for the width of the Soft Shadow
iShadowOffset The offset of the shadow from the image
cShadowColor The shadow color
cBGColor The color of the image behind the shadow


// Resize the current bitmap image to 160x120 with a black border
MyBitmap.IEConvertToThumbnail(160, 120, True, rfFastLinear, True, clBlack);