This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 498
Home
JimBobSquarePants edited this page Dec 2, 2014
·
7 revisions
Welcome to the ImageProcessor wiki!
Here you will find more in depth documentation on how to use ImageProcessor and ImageProcessor.Web
Create a project, for instance ImageProcessor.Plugins.MyProcessor
Create a new class inheriting from ImageProcessor.Processors.IGraphicsProcessor
public class MyProcessor : IGraphicsProcessor
{
public dynamic DynamicParameter { get; set; }
public Dictionary<string, string> Settings { get; set; }
public Image ProcessImage(ImageFactory factory)
{
Image processedImage = DoMyThing(factory.Image);
return processedImage;
}
}
Create an extension class. Your extension should be based on the following structure:
public static class ImageFactoryExtensions
{
public static ImageFactory ProcessWithMyFilter(this ImageFactory factory, int myParameter)
{
if (factory.ShouldProcess)
{
// TODO: Sanitize the input.
MyProcessor processor = new MyProcessor { DynamicParameter = myParameter };
factory.CurrentImageFormat.ApplyProcessor(processor.ProcessImage, factory);
}
return factory;
}
}