TIEMultiBitmap.ResampleAll
Declaration
procedure ResampleAll(NewWidth, NewHeight: integer; FilterType: TResampleFilter = rfNone; MaintainAspectRatio: Boolean = False; ShrinkOnly: Boolean = False); overload;
procedure ResampleAll(ScaleBy: Double; FilterType: TResampleFilter = rfNone); overload;
Description
Resizes (all frames of) the current image. The content of the image changes (stretched to new size).
Overload 1 Parameter | Description |
NewWidth, NewHeight | New dimensions of the image |
FilterType | Resampling interpolation algorithm (quality) |
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 |
Overload 2 Parameter | Description |
ScaleBy | The amount to scale all images. E.g. 0.5 would halve the size of all images while respecting the proportions |
FilterType | Resampling interpolation algorithm (quality) |
// Halve the size of all images in a TImageEnMView with high quality smoothing
ImageEnMView1.IEMBitmap.ResampleAll( 0.5, rfLanczos3 );
// Set the size of the all images in a TImageEnMView to a maximum of 1000,1000 (maintaining aspect ratio, and not enlarging small images)
ImageEnMView1.IEMBitmap.Resample( 1000, 1000, rfLanczos3, True, True );
// Quarter the size of all images in a TIFF file with fast but good quality smoothing
MBitmap := TIEMultiBitmap.Create();
MBitmap.LoadFromFile( 'D:\Doc.Tiff' );
MBitmap.ResampleAll( 0.25, rfFastLinear );
MBitmap.SaveToFile( 'D:\Doc.Tiff' );
MBitmap.Free;