This project has moved. For the latest updates, please go here.

Applying rotation, scale and translation to images

Mar 6, 2016 at 6:21 PM
Are there any examples out there on how to use MagickImage.Transform? I'm trying something simple, but not having much luck ...

MagickImage image = new MagickImage(imageFIle);

image.Settings.SetTransformOrigin(0, 0);
image.Settings.SetTransformScale(2, 2);

MagickGeometry geo = new MagickGeometry(image.Width, image.Height);
image.Transform(geo, geo);

Mar 6, 2016 at 9:03 PM
Edited Mar 6, 2016 at 9:08 PM
Those settings are used by annotate so this is probably not what you want. And after taking a look at the method that is called by Transform I decided to remove that method in the next release of Magick.NET.

I am not sure what you want but you can find a lot of ImageMagick examples here: Can you explain in more detail what you are trying to accomplish?
Mar 7, 2016 at 1:30 AM
Okay, good to know. I'm trying to scale, rotate and translate an image onto another (much larger image). It's just a basic affine transform where the result is composed with another image. I've played around with the command line version of IM and I think I can make that work, but I want it to work in (which I absolutely love) since this is part of a C# app.
Mar 7, 2016 at 4:53 PM
I think you are looking for the AffineTransform method of MagickImage. Can you give that a try and let me know if that works for you?