Page 1 of 1

Resize Accurate

Posted: 2014-12-02T16:49:02-07:00
by devyekov
Hello,

How I can make an accurate resize?

Because when you run the following

Code: Select all

MagickImage objMagick= new MagickImage();
objMagick.Read([PATH]);
objMagick.Quality = 100;
objMagick.Resize(new MagickGeometry(new System.Drawing.Rectangle(0, 0,744, 294)));
objMagick.Write([PATH]);
The dimension of the resulting image is 744x293 instead of 744x294

I'm using
Visual Studio 2008 C#
Platform target AnyCpu
Target Framework 2
imageMagick Magick.NET-7.0.0.0007-Q16-x64-net20
format image JPG


Thanks
Regards

Re: Resize Accurate

Posted: 2014-12-02T19:13:50-07:00
by dlemstra
You are getting that size because Imagemagick will preserve the aspect ratio. You will have to extend the image by one pixel or resize to a different size and crop the image. What are the dimensions of your source inage? You can find some more info about resize here: http://www.imagemagick.org/Usage/resize/

Re: Resize Accurate

Posted: 2014-12-03T08:49:25-07:00
by devyekov
Thank you very much for responding, in c # as specific to ignore the aspect ratio (!).

Sorry for such simple questions

Thanks
Regards

Re: Resize Accurate

Posted: 2014-12-03T09:04:09-07:00
by devyekov
jeje again thank you very much

Solution:

objMagick.Resize(new ImageMagick.MagickGeometry("744x294!"));


Thanks
Regards