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.
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 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
Please check the RotateFlipType enumeration for a full list of supported rotate and flip values.