CImage:Rotate


The Rotate method rotates the image about its image center. To rotate about a different point, use RotatePt.

Syntax

bResult = CImage:Rotate( angle, bResize=false )

bullet.gif    angle is the rotation angle in degrees.

bullet.gif    bResize controls whether the image dimension is adjusted for the scale factor.

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Remarks

The angle is measured into increasing row number with 0 degrees pointing along the positive x axis (i.e., along a row toward increasing column number). Whether the image appears rotated clockwise or counterclockwise depends upon whether the image is displayed with row number increasing upward or downward.

The optional bResize controls whether the image shape is changed to accommodate the rotation of a non-square image.

Example

Suppose an image is displayed in a CImageView named V. The following script rotates the image by 53.45 degrees and adjusts the image size to accommodate the rotated data:

I = V:GetImage()

-- attach the current displayed image

I:Rotate( 53.45, true )

-- perform the operation

V:Update()

-- update the display after the rotation

Related Topics

CImage class, RotatePt


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.