ImageEn, unit imageenproc

TImageEnProc.ImageResize

TImageEnProc.ImageResize


Declaration

procedure ImageResize(newWidth, newHeight: Integer; HorizAlign: TIEHAlign = iehLeft; VertAlign: TIEVAlign = ievTop; FillAlpha: Integer = 255); overload;
procedure ImageResize(AddLeft, AddTop, AddRight, AddBottom: integer; FillAlpha: Integer); overload;


Description

Resizes the current image. The content of the image doesn't change (no stretching).

Overload 1:
Parameter Description
NewWidth New image width
NewHeight New image height
FillAlpha Alpha value used to fill added regions (0: Fully Transparent - 255: Opaque)
HorizAlign Specifies how to horizontally align the old image
VertAlign Specifies how to vertically align the old image

Overload 2:
Parameter Description
AddLeft Pixels to add to the left of the image (or remove if AddLeft < 0)
AddTop Pixels to add to the top of the image (or remove if AddTop < 0)
AddRight Pixels to add to the right of the image (or remove if AddRight < 0)
AddBottom Pixels to add to the bottom of the image (or remove if AddBottom < 0)
FillAlpha Alpha value used to fill added regions (0: Fully Transparent - 255: Opaque)

Note: The color of added background is specified by Background


Demo

Demo  Demos\ImageEditing\Resize\Resize.dpr


Examples

// resize image to 1000x1000
ImageEnView1.Proc.ImageResize( 1000, 1000 );

// make a contour around the image
ImageEnView1.Proc.ImageResize( ImageEnView1.IEBitmap.Width + 80, ImageEnView1.IEBitmap.Height + 80, iehCenter, ievCenter );

// which is the same as:
ImageEnView1.Proc.ImageResize( 80, 80, 80, 80, clBlack, 255 );

// Add 50 pixels to the top and bottom of the image, remove 80 pixels from the left and right
ImageEnView1.Proc.ImageResize( -80, 50, -80, 50 );