This project has moved and is read-only. For the latest updates, please go here.

Resize image to a different aspect ratio

Nov 22, 2013 at 2:18 PM
I'm trying to resize an image but it is always respecting the ratio. Is there any way to resize an image to a different ratio?

Image current size: 800 x 600
Target size: 1024 x 600

magickImage.Resize(1024, 600);

Result: 1024 x 768
Nov 22, 2013 at 2:28 PM
You can use the following:
MagickGeometry geometry = new MagickGeometry(1024, 600);
geometry.Aspect = true; // Yes this looks confusing, I should rename this.

magickImage.Resize(new MagickGeometry("1024x600!"));
Nov 22, 2013 at 2:49 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.