Image Rotate and Flip Licensing Plugin

Contents
[ ]

         Effortlessly adjust the orientation of an image or photo to a fixed or custom angle, with or without flipping, using the Image Rotate and Flip License plugin. Before applying these operations, ensure you obtain a Metered license by providing your public key and private password using the `SetMeteredKey()` method. Load your image files in various formats from the list of supported image formats, then utilize the Rotate() method to set the desired angle or the RotateFlip() method to flip the image, and save the modified image in the supported format. Please note that using unlicensed features of the Aspose.Imaging graphic library will result in a watermark being applied to the output image.

using Aspose.Imaging;
using Aspose.Imaging.ImageOptions;
using Aspose.Imaging.Sources;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Net.Mime.MediaTypeNames;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
Run2();
//------------------------------------------------------------------
// Image rotate-flip plug-in example
//------------------------------------------------------------------
void Run2()
{
// Valid Image rotate-flip
Metered license = new Metered();
// Only metered plug-in license is supported
license.SetMeteredKey("<your public key>", "<your private key>");
string OutputDirectory = templatesFolder;
using (RasterImage image = (RasterImage)Image.Load(Path.Combine(templatesFolder, "template.png")))
{
var filePath = Path.Combine(OutputDirectory, "rotate_template.jpg");
image.Rotate(45);
image.Save(filePath, new JpegOptions());
}
using (RasterImage image = (RasterImage)Image.Load(Path.Combine(templatesFolder, "template.png")))
{
var filePath = Path.Combine(OutputDirectory, "flipped_template.jpg");
image.RotateFlip(RotateFlipType.Rotate270FlipX);
image.Save(filePath, new JpegOptions());
}
}

Discover the features of our free online Aspose.Imaging Flip&Rotate App website.