如何使用ImageMagick的用C# [英] how to use imageMagick with C#
本文介绍了如何使用ImageMagick的用C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你能解释我是如何使用的ImageMagick用C#。我试图将PDF转换为网页成图像。
我要运行ImageMagick的命令转换-density $ 300 $ input.pdf output.png
解决方案
字符串参数=的String.Format(@ - 密度300 {0} .PDF {1}的.png,intputFileName,outputFileName);
变种的StartInfo =新的ProcessStartInfo {
参数=参数,
=文件名@C:\path\to\imagick\convert.exe
};
的Process.Start(StartInfo的).WaitForExit();
参考文献:
Could you explain how I can use ImageMagick with C# . I am trying to convert PDF to pages into images.
I want to run imageMagick command "convert -density 300 $input.pdf $output.png"
解决方案
string arguments = string.Format(@"-density 300 {0}.pdf {1}.png", intputFileName, outputFileName");
var startInfo = new ProcessStartInfo {
Arguments = arguments,
Filename = @"C:\path\to\imagick\convert.exe"
};
Process.Start(startInfo).WaitForExit();
References:
这篇关于如何使用ImageMagick的用C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文