# Flipping an Image

## Content



Bitmap lets you flip an image vertically or horizontally. To produce a flipped image using Bitmap, you can set the [TransformOptions](/componentone/api/win/online-bitmap/dotnet-framework-api/C1.Win.Bitmap.4.8/C1.Win.Bitmap.FlipRotator.TransformOptions.html) property of the [FlipRotator](/componentone/api/win/online-bitmap/dotnet-framework-api/C1.Win.Bitmap.4.8/C1.Win.Bitmap.FlipRotator.html) class. The TransformOption property can be set through [TransformOptions](/componentone/api/win/online-bitmap/dotnet-framework-api/C1.Win.Bitmap.4.8/C1.Win.Bitmap.TransformOptions.html) enumeration.

The image below shows a horizontally-flipped image.

![Horizontally flip an image using ComponentOne Bitmap for WinForms](https://cdn.mescius.io/document-site-files/images/72c531a0-5385-45c2-adf8-8a5bec1ab564/images/bitmap-flip-image.png)

The following code illustrates flipping an image vertically or horizontally on button clicks. This example uses the sample created in the [Quick start](/componentone/docs/win/online-bitmap/QuickStart) section.

**vbnet**

```vbnet
Private Sub ApplyTransform(t As BaseTransform)
    Dim newBitmap = bitmap.Transform(t)
    bitmap.Dispose()
    bitmap = newBitmap
    selection = New RectF(1.0F, 1.0F)
    UpdateImage()
End Sub
'Event to flip the image vertically on button click
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    ApplyTransform(New FlipRotator(TransformOptions.FlipVertical))
End Sub
'Event to flip the image horizontally on button click
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    ApplyTransform(New FlipRotator(TransformOptions.FlipHorizontal))
End Sub
```

**csharp**

```csharp
void ApplyTransform(BaseTransform t)
{
    var newBitmap = bitmap.Transform(t);
    bitmap.Dispose();
    bitmap = newBitmap;
    selection = new RectF(1f, 1f);
    UpdateImage();
}
//Event to flip the image vertically on button click
private void button3_Click(object sender, EventArgs e)
{
    ApplyTransform(new FlipRotator(TransformOptions.FlipVertical));
}
//Event to flip the image horizontally on button click
private void button4_Click(object sender, EventArgs e)
{
    ApplyTransform(new FlipRotator(TransformOptions.FlipHorizontal));
}
```

## See Also

[Clipping an Image](/componentone/docs/win/online-bitmap/Features/ApplyingTransformations/ClippingImage)

[Rotating an Image](/componentone/docs/win/online-bitmap/Features/ApplyingTransformations/RotatingImage)

[Scaling an Image](/componentone/docs/win/online-bitmap/Features/ApplyingTransformations/ScalingImage)