Resize Accurate

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
devyekov
Posts: 19
Joined: 2014-12-01T08:16:19-07:00
Authentication code: 6789

Resize Accurate

Post by devyekov » 2014-12-02T16:49:02-07:00

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

User avatar
dlemstra
Posts: 1568
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Resize Accurate

Post by dlemstra » 2014-12-02T19:13:50-07:00

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/
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

devyekov
Posts: 19
Joined: 2014-12-01T08:16:19-07:00
Authentication code: 6789

Re: Resize Accurate

Post by devyekov » 2014-12-03T08:49:25-07:00

Thank you very much for responding, in c # as specific to ignore the aspect ratio (!).

Sorry for such simple questions

Thanks
Regards

devyekov
Posts: 19
Joined: 2014-12-01T08:16:19-07:00
Authentication code: 6789

Re: Resize Accurate

Post by devyekov » 2014-12-03T09:04:09-07:00

jeje again thank you very much

Solution:

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


Thanks
Regards

Post Reply