CImage:Crop

CImage:Affine


The Affine method applies an affine transformation of shift, scale, and rotation to the image.

Syntax

bResult = CImage:Affine( nX, nY, nAngle, nScale, bResize=false )

Remarks

The affine transformation shifts the image center, then applies the rotation and the scale factor.

Example

The following script fragment shifts the image 10 pixels in x and 20.52 in y, rotates -30.25 degrees, and scales by 1.2 times:

 

I = CImage:new()

-- create a new CImage

nX = 10 ; nY = 20.52

-- shifts

A = -30.25 ; M = 1.2

-- angle and magnification

I:Affine( nX, nY, A, M )

-- perform the operation on image I

Related Topics

CImage , SetResampleParams