Image Converter Licensing Plugin

Contents
[ ]

         Utilize the Image Converter license plugin to swiftly transform images from one file format to another, using our wide list of supported formats. Before initiating the conversion process, ensure you apply for a Metered license by providing your public key and private password using the `SetMeteredKey()` method. Then, load your image file, such as in PNG format, using the `Load()` method, and proceed to save it in JPEG format using the `Save()` method along with the `JpegOptions()` object parameter. Attempting to utilize an unlicensed feature of the Aspose.Imaging graphic library will result in a watermark appearing on the resultant 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;
Run();
//------------------------------------------------------------------------
// Conversion plug-in use sample
//------------------------------------------------------------------------
void Run()
{
// Conversion plug-in licensed use example
Metered license = new Metered();
// Only metered plug-in license is supported
license.SetMeteredKey("<your public key>", "<your private key>");
string OutputDirectory = templatesFolder;
using (Image image = Image.Load(Path.Combine(templatesFolder, "template.png")))
{
var filePath = Path.Combine(templatesFolder, "licensed_tiger0.jpg");
image.Save(filePath, new JpegOptions());
File.Delete(filePath);
}
// Unlicensed use of resize with conversion license
using (Image image = Image.Load(Path.Combine(templatesFolder, "template.png")))
{
var filePath = Path.Combine(templatesFolder, "trial_tiger0.jpg");
image.Resize(image.Width << 1, image.Height << 1);
image.Save(filePath, new JpegOptions());
File.Delete(filePath);
}
}

Explore the functionality of our free online conversion application demo directly on the Aspose.Imaging Conversion App website.