ImageEn, unit imageenproc

TImageEnProc.ResampleTo

TImageEnProc.ResampleTo

Declaration

procedure ResampleTo(Dest: TIEBitmap; DestWidth, DestHeight: Integer; FilterType: TResampleFilter; MaintainAspectRatio: Boolean = False);

Description

Copies a resized instance of the current image to a Dest TIEBitmap. The content of the destination image changes (i.e. it is stretched to the new size).
Parameter Description
Dest The destination image
DestWidth Width in pixels of the destiatnion . If DestWidth is -1 then it is calculated automatically, respecting the proportions
DestHeight Height in pixels of the destination. If DestHeight 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

Supported filters by PixelFormat:
Filter ie1g ie8g ie16g ie24RGB ie32RGB ie48RGB
rfNone                  
rfTriangle                  
rfHermite                  
rfBell                  
rfBSpline                  
rfLanczos3                  
rfMitchell                  
rfNearest                  
rfLinear                  
rfFastLinear                  
rfBilinear                  
rfBicubic                  
rfProjectBW                  
rfProjectWB                  
rfWICNearestNeighbor                  
rfWICLinear                  
rfWICCubic                  
rfWICFant                  
rfWICCubicHQ                  

See also: Resample

Example

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