ImageEn, unit iexHelperFunctions

IEResampleImageFile

IEResampleImageFile


Declaration


function IEResampleImageFile(const sInFilename, sOutFilename: string;
                             JpegQuality: Integer;
                             MaxX, MaxY: Integer;
                             StretchSmall: Boolean = False;
                             QualityFilter: TResampleFilter = rfLanczos3;
                             AutoAdjustOrientation: Boolean = False;
                             bStripMetaData: Boolean = False
                             ): Boolean;


Description


Loads an image of any format, resizes it and saves it to file (of any format).

Parameter Description
JpegQuality Specify the JPEG_Quality if sOutFilename is a JPEG
MaxX, MaxY 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)
StretchSmall Set to false to avoid images smaller than MaxX x MaxY from being made larger
QualityFilter Specify the quality that is used for rescaling the image
AutoAdjustOrientation Sets EnableAdjustOrientation to automatically re-orient JPEG camera images
bStripMetaData If enabled ResetInfo is used to strip meta-data from the image and make it smaller



Example


// Resize MyImage.jpeg to the screen dimensions and save to MyImage_Screen.jpeg
IEResampleImageFile('D:\MyImage.jpeg', 'D:\MyImage_Screen.jpeg', 90, Screen.Width, Screen.Height, False);