首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从.Net调用图像魔术命令

从.Net调用图像魔术命令
EN

Stack Overflow用户
提问于 2013-04-16 11:23:53
回答 1查看 1.3K关注 0票数 0

我正在尝试在.NET应用程序中调用Image Magick。这是非常奇怪的,当我复制相同的参数,并使用命令行调用它。这是可以的,但当我通过我的C#应用程序调用它时,我在最后得到了错误。我不知道为什么当我通过我的应用程序调用它时,它会期望一个Affine参数。请帮帮忙。

代码语言:javascript
复制
  var proc = new Process
   {
      StartInfo = new ProcessStartInfo
     {
    FileName = @"C:\Program Files (x86)\ImageMagick-6.8.4-Q16\convert.exe",
    Arguments = "\"C:\\Users\\Pouya\\Desktop\\Rugs\\test.jpg\" -matte -virtual-pixel transparent -distort Perspective ' 2,2 0,0 2,198 0,200 198,198 200,200 198,2 200,0' \"C:\\Users\\Pouya\\Desktop\\Rugs\\testResult.jpg\"",
    UseShellExecute = false,
    RedirectStandardError = true,
    CreateNoWindow = true
     }
   };

 proc.Start();`

“镜像:选项仿射的参数无效:‘至少需要1个CPs’@ error/distort.c/GenerateCoefficients/530.\r\nconvert.exe:无法打开镜像2,2': No such file or directory @ error/blob.c/OpenBlob/2641.\r\nconvert.exe: no decode delegate for this image format2,2‘@ error/constitute.c/ReadImage/550.\r\nconvert.exe:无法打开镜像2,2': No such file or directory @ error/blob.c/OpenBlob/2641.\r\nconvert.exe: no decode delegate for this image format0,0’@ error/constitute.c/ReadImage/550.\r\nconvert.exe:无法打开镜像2,198': No such file or directory @ error/blob.c/OpenBlob/2641.\r\nconvert.exe: no decode delegate for this image format2,198‘@CPs无法打开镜像CPs 2,198’@CPs无法打开镜像CPs 2,2‘@CPs无法打开镜像CPs 0,0’@CPs无法打开镜像CPs 2,198‘@CPs无法打开镜像CPs 2,2’@CPs无法打开镜像CPs 0,0‘@CPs无法打开镜像CPs 2,198’要打开图像错误0,200‘@ error/constitute.c/ReadImage/550.\r\nconvert.exe:无法打开图像错误198,198’@ error/constitute.c/ReadImage/550.\r\nconvert.exe:无法打开图像错误200,200‘@ error/constitute.c/ReadImage/550.\r\nconvert.exe:无法打开图像错误198,2’@ error/constitute.c/ReadImage/550.\r\nconvert.exe:无法打开图像200,0'': No such file or directory @ error/blob.c/OpenBlob/2641.\r\nconvert.exe: no decode delegate for this image format200,0'‘@198,198': No such file or directory @ error/blob.c/OpenBlob/2641.\r\nconvert.exe: no decode delegate for this image format/Builte.c/ReadImage/550。\r\n“

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-04-16 11:34:05

' 2,2 0,0 2,198 0,200 198,198 200,200 198,2 200,0'两边的单引号更改为转义双引号。还要去掉第一个引号后面的额外前导空格:

代码语言:javascript
复制
\"2,2 0,0 2,198 0,200 198,198 200,200 198,2 200,0\" 
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16028228

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档