ImageEn, unit iexBitmaps

TIEBitmap.Resample

TIEBitmap.Resample


Declaration


procedure Resample(NewWidth, NewHeight: integer; FilterType: TResampleFilter = rfNone; MaintainAspectRatio : Boolean = False; ShrinkOnly : Boolean = False); overload;
procedure Resample(ScaleBy: Double; FilterType: TResampleFilter = rfNone); overload;


Description


Resizes the current image. The content of the image changes (stretched to the new size).

Parameter Description
NewWidth New image width in pixels. If NewWidth is -1 then it is calculated automatically, respecting the proportions.
NewHeight New image height in pixels. If NewHeight is -1 then it is calculated automatically, respecting the proportions.
FilterType Resampling interpolation algorithm.
MaintainAspectRatio Automatically reduces NewWidth or NewHeight to ensure the original proportions of the image are maintained
ShrinkOnly If true and the new dimensions would enlarge the image, the resampling as skipped



Examples


ABitmap.Resample( 50, -1, rfNone ); // Resizes the image to width of 50 (with height automatically set) without any smoothing algorithm
ABitmap.Resample( -1, 100, rfLanczos3 ); // Resizes the image to height of 100 (with width automatically calculated) and high quality smoothing
ABitmap.Resample( 100, 100, rfLanczos3, True ); // Resizes the image so that it is no higher or wider than 100, but maintains the original aspect ratio (e.g. a 4:3 portrait image would have the new dimensions 100 x 75)
ABitmap.Resample( 0.5, rfFastLinear ); // Resizes the image to half its current size with fast, but good quality smoothing