ImgScale

Top  Previous  Next

Prototype

 

ImgScale(intImageHandle, intNewWidth, intNewHeight, bootInterpolate)

 

Description

 

Resizes the current image, scaling content width and height.

 

Parameters

 

intImageHandle: integer value corresponding to the image handle.

 

intNewWidth: integer value that specifies the new width in pixels.

 

intNewHeight: integer value that specifies the new height in pixels.

 

bootInterpolate: boolean value that specifies if to use pixels interpolation.

 

Returned value

 

None.

 

Notes

 

To resize only image canvas see ImgResize.

 

Example

 

// =============================================

// This sample scale image size matching 200 DPI

// =============================================

 

// Get current resolution

XRes:=ImgGetHorzResolution(_CurrentImage);

YRes:=ImgGetVertResolution(_CurrentImage);

 

// Get current size

XSize:=ImgGetWidth(_CurrentImage);

YSize:=ImgGetHeight(_CurrentImage);

 

// Calculate new size at 200 DPI

NewXSize:=Round((XSize/XRes)*200);

NewYSize:=Round((YSize/YRes)*200);

 

// Scale the image to a new size

ImgScale(_CurrentImage, NewXSize, NewYSize, True);

 

// Set image to 200 DPI resolution

ImgSetHorzResolution(_CurrentImage, 200);

ImgSetVertResolution(_CurrentImage, 200);