Rotate method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

Delphi 4 example

C++ Builder example

 

Syntax

short Rotate (ILEADRaster *pRaster, 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:

image\sqrblit.gif It uses the center of the bitmap as the center of rotation.

image\sqrblit.gif It can rotate the bitmap clockwise or counterclockwise up to 360 degrees in hundredth-of-a-degree increments.

image\sqrblit.gif 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.

image\sqrblit.gif It lets you specify the background color to fill any new area created by the rotation.

The only images that are interpolated are:

image\sqrblit.gif 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.

image\sqrblit.gif 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 LevelHighBit property property, or if WindowLevel method has been called. Call Grayscale(12) or Grayscale(16) if Rotate doesn’t seem to do any interpolation during the rotation.

image\sqrblit.gif 16-bit color images

image\sqrblit.gif 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

 

Using Color Values in LEADTOOLS

 

Raster Images: Methods That Transform the Region and the Bitmap (Document/Medical only)