CImage:RotatePt


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

Syntax

bSuccess = CImage:RotatePt( nAngle, x, y )

bSuccess = CImage:RotatePt( nAngle, x, y, bResize )

 

where

    nAngle 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. It defaults to true.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

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.

This method resamples the image to calculate the new values at fractional pixel locations. Resampling is controlled by members of the ResampleParams table. The image is not resampled if both x and y shifts are integral values. When resampling is needed, you can either do nothing and use the default parameters or set specific parameters and then call SetResampleParams function.

Example

Suppose an image is displayed in a CImageView named V. The following script rotates the image by 1.62 degrees around the point 100, 204.5. The image size is not adjusted.

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

Rotate

Image Geometry Methods

CImage class