CImage:Reorient


The Reorient method performs one of a variety of reorientation transformations on an image.

Syntax

bResult = CImage:Reorient( method, bResize=false )

bullet.gif    method is the operation code (see Remarks).

bullet.gif    bResize controls whether the image shape is changed by the transformation.

bullet.gif    On success, this method returns true.

bullet.gif    On failure, this method returns false.

Remarks

This method is a single function that embodies the functionality or Hflip, Vflip, Rot90, Rot180, Rot270, and Transpose. Using this method avoids constructing a if...elseif table when the method is unknown or several transformations are applied in succession. The methods are defined in the following table:

Reorient Methods

Operation

Method

Description

Hflip

1

Horizontal flip

Vflip

2

Vertical flip

Rot90

3

Rotate 90 degrees

Rot180

4

Rotate 180 degrees

Rot270

5

Rotate 270 degrees

Transpose

6

Flip about main diagonal

If the optional bResize argument is omitted or set to false, the image retains its original number of columns and rows.

Example

Suppose that a CImage I exists. The following script rotates the image 180 degrees, then flips it horizontally:

I:Reorient( 4 )

-- perform 180 degree rotation

I:Reorient( 1 )

-- perform horizontal flip

Related Topics

CImage


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