public static void Run()
{
// ExStart:RotatingImageOnSpecificAngle
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_ModifyingAndConvertingImages();
// Load an image to be rotated in an instance of RasterImage
using (RasterImage image = (RasterImage)Image.Load(dataDir + "aspose-logo.jpg"))
{
// Before rotation, the image should be cached for better performance
if (!image.IsCached)
{
image.CacheData();
}
// Perform the rotation on 20 degree while keeping the image size proportional with red background color and Save the result to a new file
image.Rotate(20f, true, Color.Red);
image.Save(dataDir + "RotatingImageOnSpecificAngle_out.jpg");
}
// ExEnd:RotatingImageOnSpecificAngle
}
}