ImageEn, unit ievision

TIEVisionImage.resize

TIEVisionImage.resize


Declaration

function resize(dst: TIEVisionImage; interpolation: TIEVisionInterpolation = ievLINEAR): TIEVisionImage; overload; safecall;
function resize(newWidth: int32_t; newHeight: int32_t; interpolation: TIEVisionInterpolation = ievLINEAR): TIEVisionImage; overload; safecall;


Description

Resizes (resamples) current image to the specified size, using an interpolation filter.
First overload stores the resized image in the specified destination object. Uses destination size as resize parameters. Source image remains untouched. Returns the destination object.
Second overload resizes the image inplace, returning itself.

Note: You can use assignIEVisionImage to reflect this methods changes in the associated bitmap

Parameter Description
dst Container for the resized image
interpolation Interpolation filter
newWidth New image width. If less than 0, this is auto-calculated
newHeight New image height. If less than 0, this is auto-calculated


Examples

// resizes image1 to 1000x1000, using CUBIC interpolation
image1.resize(1000, 1000, ievCUBIC);

// resizes image1 to the size of image2 (1000x1000)
image2.create(1000, 1000, ievUINT8, 3);
image1.resize(image2, ievCUBIC);

// Double size of image
ImageEnView1.IO.LoadFromFile( 'D:\im300a.jpg' );
DestIEViewer1.IEBitmap.Allocate( ImageEnView1.IEBitmap.Width * 2, ImageEnView1.IEBitmap.Height * 2 );
ImageEnView1.IEBitmap.GetIEVisionImage().resize( DestIEViewer1.IEBitmap.GetIEVisionImage(), ievCUBIC );
DestIEViewer1.Update();