Download this: http://magick.codeplex.com
Update link: https://github.com/dlemstra/Magick.NET
also available via NuGet package manager.
In your project, make a reference to the ImageMagickNET.dll
You may need to set the platform to x86 in you configuration
Now you can use this code to resize an image:
ImageMagickNET.MagickNet.InitializeMagick();
var image = new ImageMagickNET.Image("test.jpg");
image.Resize(new ImageMagickNET.Geometry("50%"));
image.Write("result.jpg");
Instead of using the ImageMagick.Net library you could also use the program directly:
var proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "convert.exe",
Arguments = "-resize 50% -draw \"gravity south fill black text 0,0 'Watermark' \" test.jpg result.jpg",
UseShellExecute = false,
RedirectStandardError = true,
CreateNoWindow = true
}
};
proc.Start();
string error = proc.StandardError.ReadToEnd();
proc.WaitForExit();