如何在c#中使用ImageMagick 6.7.8调整图像大小 [英] how to resize an image with ImageMagick 6.7.8 in c#
本文介绍了如何在c#中使用ImageMagick 6.7.8调整图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI,
我正在尝试使用ImageMagick(第三个程序)在c#
中调整图像大小但是命令
//使用ImageMagick调整图像大小
var image = new ImageMagickObject.MagickImage(NewName);
List< object> convertParams = new List< object>();
image.resize(%50); // --->不起作用(无法识别调整大小)
I'm trying to resize an image with ImageMagick ( third program) in c#
however the command
// use ImageMagick to resize images
var image = new ImageMagickObject.MagickImage(NewName);
List<object> convertParams = new List<object>();
image.resize("%50"); //---> does not work ( resize is not recognized)
推荐答案
那是因为MagickImage
没有调用的方法调整
。它有一个名为Convert
的方法,它接受一个描述你想要做什么的参数数组。可用选项记录在ImageMagick网站上 [ ^ ]。
For例如:
That's because theMagickImage
doesn't have a method calledresize
. It has a method calledConvert
, which accepts an array of arguments describing what you want to do. The available options documented on the ImageMagick site[^].
For example:
var image = new ImageMagickObject.MagickImage();
image.Convert("InputImage.jpg", "-resize", "50%", "OutputImage.jpg");
根据此文档, http:// magick。 codeplex.com/wikipage?title=Resize%20image&referringTitle=Documentation [ ^ ]方法是Resize,大写R,而不是小写r。另外,正如评论中一样,我怀疑%50会起作用。
According to this document, http://magick.codeplex.com/wikipage?title=Resize%20image&referringTitle=Documentation[^] the method is Resize, capital R, not lower case r. Also, as in comments, I doubt %50 would work.
这篇关于如何在c#中使用ImageMagick 6.7.8调整图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文