CImage:Reorient
The Reorient method performs one of a variety of reorientation transformations on an image. This applies only to 2-dimensional images.
bSuccess = CImage:Reorient( nMethod ) bSuccess = CImage:Reorient( nMethod, bResize ) where |
nMethod is the operation code.
bResize is true or false to control whether the image shape is changed by the transformation. It defaults to true.
bSuccess is the returned success code. On success it is true, otherwise false.
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 |
1 |
Horizontal flip |
|
2 |
Vertical flip |
|
3 |
Rotate 90 degrees |
|
4 |
Rotate 180 degrees |
|
5 |
Rotate 270 degrees |
|
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.
Suppose that a CImage I exists. The following script rotates the image 180 degrees, then flips it horizontally:
|
-- perform 180 degree rotation |
|
-- perform horizontal flip |