我正在尝试在.NET应用程序中调用Image Magick。这是非常奇怪的,当我复制相同的参数,并使用命令行调用它。这是可以的,但当我通过我的C#应用程序调用它时,我在最后得到了错误。我不知道为什么当我通过我的应用程序调用它时,它会期望一个Affine参数。请帮帮忙。
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“
发布于 2013-04-16 11:34:05
将' 2,2 0,0 2,198 0,200 198,198 200,200 198,2 200,0'两边的单引号更改为转义双引号。还要去掉第一个引号后面的额外前导空格:
\"2,2 0,0 2,198 0,200 198,198 200,200 198,2 200,0\" https://stackoverflow.com/questions/16028228
复制相似问题