CImage:Affine
The Affine method applies an affine transformation of shift, scale, and rotation to the image.
bResult = CImage:Affine( nX, nY, nAngle, nScale, bResize=false )
nX and nY specify the shifts, in pixel units.
nAngle is the rotation angle, in degrees.
nScale is the magnification relative to 1.0.
bResize is optional and controls whether the image is expanded to hold the scaled image.
On success, true is returned, otherwise false is returned.
The affine transformation shifts the image center, then applies the rotation and the scale factor.
The following script shifts the image 10 pixels in x and 20.52 in y, rotates -30.25 degrees, and scales by 1.2 times:
|
-- create a new CImage |
|
-- shifts |
|
-- angle and magnification |
|
-- perform the operation on image I |
CImage class, SetResampleParams
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.