Rotate method (Main Control)
Visual Basic example
Visual C++ 4.0 example
Access 2.0 example
Access
95, 97 example
Visual
J++ example
Syntax short Rotate (long iAngle, short iFlags, OLE_COLOR crFill);
Overview: Refer to Examining and Altering Bitmaps.
Remarks
Rotates the bitmap by the hundredths of degrees specified, and lets you specify the background color to be uncovered.
This method has the following features:
It uses the center of the bitmap as the center of rotation.
It can rotate the bitmap clockwise or counterclockwise up to 360 degrees in hundredth-of-a-degree increments.
It can resize the bitmap to accommodate the rotated height and width, or it can retain the original height and width, cropping the bitmap as necessary.
It lets you specify the background color to fill any new area created by the rotation.
The only images that are interpolated are:
8-bit grayscale images (for best results, all gray values should be in the bitmap’s palette). If the rotation doesn’t give the expected results, you can call Grayscale (8) to change the bitmap into a proper grayscale bitmap.
12-bit and 16-bit grayscale bitmaps that don’t have a palette. Grayscale bitmaps can have a palette if they have been loaded from certain DICOM images or if the control’s bitmap has been changed by setting the LowBit, HighBit properties, or if GetWindowLevel method has been called. Call Grayscale(12) or Grayscale(16) if Rotate doesn’t seem to do any interpolation during the rotation.
16-bit color images
24-bit, 32-bit, 48-bit and 64-bit color images
For the other images, the Rotate method ignores the interpolation flags and the rotate is performed without interpolation.
ROTATE_RESAMPLE and ROTATE_BICUBIC can be combined with ROTATE_RESIZE, but not with each other. So you can pass ROTATE_RESAMPLE|ROTATE_RESIZE, but not ROTATE_RESAMPLE|ROTATE_BICUBIC.
If ROTATE_RESIZE is set, then the image is resized. Otherwise, the image is cropped.
See Also
Elements: FastRotate method
Topics: Raster
Images: Doing Geometric Transformations
Raster Images: Methods That Transform the Region and the Bitmap (Document/Medical
only)