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