Image Resizer Licensing Plugin

Contents
[ ]

         Easily adjust image sizes while retaining control over resolution and quality with the Image Resizer license plugin. Before starting, ensure you acquire a Metered license by providing your public key and private password using the `SetMeteredKey()` method. Import your image in a compatible format from the list of supported formats, then employ the Resize() method to modify the image dimensions according to your preferences. Finally, save the resized image. Remember that using an unlicensed feature of the Aspose.Imaging graphic library will result in a watermark being applied to the output image.

using Aspose.Imaging;
using Aspose.Imaging.FileFormats.Emf;
using Aspose.Imaging.FileFormats.Png;
using Aspose.Imaging.FileFormats.Tiff;
using Aspose.Imaging.FileFormats.Tiff.Enums;
using Aspose.Imaging.ImageOptions;
using Aspose.Imaging.Sources;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
Run3();
//------------------------------------------------------------------------------
// Resize plug-in license use examples
//------------------------------------------------------------------------------
void Run3()
{
// Valid resize license use example
Metered license = new Metered();
// Only metered plug-in license is supported
license.SetMeteredKey("<your public key>", "<your private key>");
string OutputDirectory = templatesFolder;
if (!Directory.Exists(OutputDirectory))
{
Directory.CreateDirectory(OutputDirectory);
}
using (Image image = Image.Load(Path.Combine(templatesFolder, "template.png")))
{
var filePath = Path.Combine(OutputDirectory, "licensed_tiger0.jpg");
image.Resize(image.Width << 1, image.Height << 1);
image.Save(filePath, new JpegOptions());
File.Delete(filePath);
}
// Unlicensed use of flip rotate with resize license
using (Image image = Image.Load(Path.Combine(templatesFolder, "template.png")))
{
var filePath = Path.Combine(OutputDirectory, "trial_tiger0.jpg");
image.RotateFlip(RotateFlipType.Rotate180FlipXY);
image.Save(filePath, new JpegOptions());
File.Delete(filePath);
}
}

Explore the functionalities of our free online Aspose.Imaging Resize App website.