---
title: "Rotating and Flipping Images"
canonical: https://www.graphicsmill.com/docs/gm5/RotatingandFlippingImages.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# Rotating and Flipping Images
 
Image rotating and flipping is a basic imaging operation. Graphics Mill for .NET provides transform classes that allow applying them. There are two implementations of the image rotating algorithms: for rotating image at arbitrary angle, and special optimized algorithm for fixed angles that equal 90, 180, or 270 degrees.
 
You can use a transform class [Rotate](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_Rotate.htm.md) to rotate the image at the arbitrary angle. This angle is specified with property [Angle](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_Rotate_Angle.htm.md), which is measured in degrees. Image is rotated clockwise (negative angles make image rotated counter-clockwise):
 
![](https://www.graphicsmill.com/docs/gm5/ImageConcept4.png)
 
Quality and speed of the rotation depends on the [InterpolationMode](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_Rotate_InterpolationMode.htm.md) property. Some interpolation modes works fast, but have lower quality, some ones are working slow, but has high quality. To make resizing algorithms selection easier, you can use values such [InterpolationMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_InterpolationMode.htm.md) enumeration members as **LowQuality ( = HighSpeed)**, **MediumQuality ( = MediumSpeed)** or **HighQuality (LowSpeed)** . These values specifies the best algorithm according to your needs. Nevertheless if you would like to get more detailed information about interpolation modes, read topics [Comparison of Interpolation Modes](https://www.graphicsmill.com/docs/gm5/ComparisonofInterpolationModes.htm.md) and [Interpolation Inside](https://www.graphicsmill.com/docs/gm5/InterpolationInside.htm.md).
 
To be able to use shorter syntax, you can use [Rotate](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_TransformsProvider_Rotate.htm.md) method of the [TransformsProvider](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_TransformsProvider.htm.md) returned by the [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md). Here is a code example that demonstrates it:
 
```
'Rotate at 5 degrees with medium quality
bitmap.Transforms.Rotate(5, Aurigma.GraphicsMill.RgbColor.Yellow, _
 Aurigma.GraphicsMill.Transforms.InterpolationMode.MediumQuality)
```
 
```csharp
//Rotate at 5 degrees with medium quality
bitmap.Transforms.Rotate(5, Aurigma.GraphicsMill.RgbColor.Yellow, 
    Aurigma.GraphicsMill.Transforms.InterpolationMode.MediumQuality);
```
 
This code rotates the image using Rotate class:
 
```
'Rotate at 5 degrees with medium quality
Dim rotate As New Aurigma.GraphicsMill.Transforms.Rotate
rotate.Angle = 5
rotate.BackgroundColor = Aurigma.GraphicsMill.RgbColor.Yellow
rotate.InterpolationMode = Aurigma.GraphicsMill.Transforms.InterpolationMode.MediumQuality
rotate.ApplyTransform(bitmap)
```
 
```csharp
//Rotate at 5 degrees with medium quality
Aurigma.GraphicsMill.Transforms.Rotate rotate =
    new Aurigma.GraphicsMill.Transforms.Rotate();
rotate.Angle = 5;
rotate.BackgroundColor = Aurigma.GraphicsMill.RgbColor.Yellow;
rotate.InterpolationMode = Aurigma.GraphicsMill.Transforms.InterpolationMode.MediumQuality;
rotate.ApplyTransform(bitmap);
```
 
To flip image or rotate it at 90, 180, or 270, you should use [RotateAndFlip](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_RotateAndFlip.htm.md) class. It has the single parameter [Mode](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_RotateAndFlip_Mode.htm.md), which specifies one of 8 combinations of flip and rotate, e.g. flip horizontally and rotate at 90 degrees, flip vertically only, do not flip and rotate at 180 degrees, etc.
 
**Note** 
If you rotate the image at 90, 180, or 270, this transform works much faster than Rotate. That's why we recommend using this class for these three angles.
 
This class also duplicated by RotateAndFlip method of the TransformsProvider returned by the Bitmap. Here is a code example that demonstrates how to use it:
 
```
bitmap.Transforms.RotateAndFlip(System.Drawing.RotateFlipType.Rotate90FlipNone)
```
 
```csharp
bitmap.Transforms.RotateAndFlip(System.Drawing.RotateFlipType.Rotate90FlipNone);
```
 
This code rotates the image using RotateAndFlip class:
 
```
Dim rotateAndFlip As New Aurigma.GraphicsMill.Transforms.RotateAndFlip
rotateAndFlip.Mode = System.Drawing.RotateFlipType.Rotate90FlipNone
rotateAndFlip.ApplyTransform(bitmap)
```
 
```csharp
Aurigma.GraphicsMill.Transforms.RotateAndFlip rotateAndFlip =
    new Aurigma.GraphicsMill.Transforms.RotateAndFlip();
rotateAndFlip.Mode = System.Drawing.RotateFlipType.Rotate90FlipNone;
rotateAndFlip.ApplyTransform(bitmap);
```
