ImageEn, unit iexBitmaps

TIEBitmap.Rotate

TIEBitmap.Rotate


Declaration


procedure Rotate(Angle: double; AntialiasMode: TIEAntialiasMode = ierFast; BackgroundColor: TColor = clWhite);


Description


Rotates the current image by the specified angle (negative or positive degrees counter-clockwise).

AntialiasMode specifies the anti-aliasing algorithm that is used to improve rotation quality:
  ierNone : No anti-aliasing (lowest quality)
  ierFast : Fast but lower quality
  ierBilinear : Bilinear, high quality
  ierBicubic : Bicubic, highest quality

BackgroundColor specifies a background color to fill new regions (i.e. when not rotating at a 90 degree angle)

Note: If the image has an alpha channel then the null area is filled with transparency (so you will not see the background color). To prevent the transparent area, and force a background color fill, remove the alpha channel


Examples


// Rotate the image 45 clockwise at highest quality with a white background color
ABitmap.Rotate(315, ierBicubic, clWhite);

// Rotate the image 90 clockwise (Note: AntialiasMode is irrelevant for 90 deg. rotates)
ABitmap.Rotate(270);

// Rotate the image 180 clockwise
ABitmap.Rotate(180);

// Rotate the image 90 counter-clockwise;
ABitmap.Rotate(90);

// Rotate the image 45 clockwise, with good quality, and the null area created by the rotation set as transparent
ABitmap.AlphaChannel; // Create an alpha channel if one does not exist
ABitmap.Rotate( -45, ierBicubic );

// Rotate the image 45 clockwise, with good quality, and the null area created by the rotation set as black
ABitmap.RemoveAlphaChannel; // Remove alpha channel if there is one
ABitmap.Rotate( -45, ierBicubic, clBlack );


See Also


- Global Image Methods
- AngleToImageEnRotateAngle