CImage:Rotate CImage:Shift

CImage:RotatePt


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

Syntax

bResult = CImage:RotatePt( angle, x, y, bResize=false )

    angle is the rotation angle in degrees.

    x and y specify the rotation point, in pixel coordinates.

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

    On success, this method returns true.

    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 fragment rotates the image by 1.62 degrees around the point 100, 204.5. The image size is not adjusted because the optional bResize argument is allowed to default to false:

 

I = V:GetImage()

-- attach the current displayed image

I:RotatePt(1.45,100,204.5)

-- perform the operation

V:Update()

-- update the display after the rotation

Related Topics

CImage, Rotate