Rotate and flip image files

The following example shows how you can easily rotate an image at 90 degrees and flip it horizontally using GemBox.Imaging in C# and VB.NET.

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%"))
        {
            // Rotate the image by 90 degrees and flip it horizontally.
            image.RotateFlip(RotateFlipType.Rotate90FlipX);

            // Save the rotated and flipped 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%")
			' Rotate the image by 90 degrees and flip it horizontally.
			image.RotateFlip(RotateFlipType.Rotate90FlipX)

			' Save the rotated and flipped image.
			image.Save("RotatedFlipped.png")
		End Using
	End Sub
End Module
Image file which is rotated/flipped using GemBox.Imaging
Screenshot of an image file rotated and flipped using GemBox.Imaging

Please check the RotateFlipType enumeration for a full list of supported rotate and flip values.

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