ImageEn, unit imageenproc

TImageEnProc.ResampleTo

TImageEnProc.ResampleTo


Declaration

procedure ResampleTo(Target: TIEBitmap; TargetWidth, TargetHeight: Integer; FilterType: TResampleFilter);


Description

Copies a resized instance of the current image to a Target TIEBitmap. The content of the destination image changes (i.e. it is stretched to the new size).

Parameter Description
Target The target (destination) image.
TargetWidth Width in pixels of the target size. If TargetWidth is -1 then it is calculated automatically, respecting the proportions.
TargetHeight Height in pixels of the target size. If TargetHeight is -1 then it is calculated automatically, respecting the proportions.
FilterType Resampling interpolation algorithm.
bMaintainAspectRatio Automatically reduces NewWidth or NewHeight to ensure the original proportions of the image are maintained

Resampling black & white (1bit) images with FilterType is not rfNone, Resample converts the image to 24bit.

See also: Resample.


Example

// Create a thumbnail of image in ImageEnView1 to ImageEnView2. Height and width are no larger than 100 pixels
ImageEnView1.Proc.ResampleTo( ImageEnView2.IEBitmap, 100, 100, rfFastLinear, True);
ImageEnView2.Update;