Rotate/Flip image files in C# and VB.NET

With GemBox.Imaging, you can rotate/flip image files from your C# or VB.NET application.

To rotate an image using GemBox.Imaging, you can specify how much an image is rotated and the axis used to flip the image. Check all the FlipTypes you can use while working with this component.

The following example shows how you can easily rotate/flip an image at 90 degrees using C# and VB.Net and save it to various formats.

Image file which is rotated/flipped using GemBox.Imaging
Screenshot of Xamarin Android app that rotates/flips the image
Upload your file (Drag file here)
using GemBox.Imaging;

class Program
{
    static void Main()
    {
        // If using the Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        using (var image = Image.Load("%InputFileName%"))
        {
            // Rotating the image
            image.RotateFlip(RotateFlipType.Rotate90FlipNone);

            // Saving the rotated image
            image.Save("RotatedFlipped.png");
        }
    }
}
Imports System
Imports GemBox.Imaging

Module Program

	Sub Main()

		' If using the Professional version, put your serial key below.
		ComponentInfo.SetLicense("FREE-LIMITED-KEY")
		
		Using image As Image = Image.Load("%InputFileName%")
			' Rotating the image
			image.RotateFlip(RotateFlipType.Rotate180FlipY)

			' Saving the rotated image
			image.Save("RotatedFlipped.png")
		End Using
	End Sub
End Module

See also


Next steps

GemBox.Imaging is a .NET component that provides an easy way to load, edit, save images. GemBox.Imaging also supports file format conversions and image transformations (resize, crop, rotate and flip).

Download Buy