Rotate the image by a given angle.
The aspect ratio (the ratio of horizontal to vertical resolution) of the image is very important to this operation. If the aspect ratio is not set correctly, the image will be stretched horizontally or vertically during rotation. If the rotation angle is very close to -360, -180, 0, 180, or 360, there will be little distortion. If the rotation angle is much different from those values, there may significant distortion.
For example, coarse faxes have an aspect ratio of 1 to 2, meaning that each pixel is rectangular and is twice as tall as it is wide, and are typically 1728 pixels wide and 1100 pixels tall (8.5" x 11"). If a coarse fax is rotated 90 degrees, ignoring the aspect ratio, it will become 1100 pixels wide and 1728 pixels tall (5.5" x 17") and will appear to have been stretched by 4 times vertically. If the resolution is set properly, this method would produce an image that is 2200 pixels wide and 864 pixels tall (11" x 8.5").
Note: There are situations where the aspect ratio handling is not desirable. For example, if a 200 DPI x 100 DPI image is rotated 90 degrees and the desired output is 100 DPI x 200 DPI, then the horizontal and vertical resolutions should be set to the same values and the final resolution should be overridden with the desired values after the operation has completed.
Syntax
Parameters
- options
- A RotateOptions object that specifies how to rotate the image.
Exceptions
See Also