c++运行imagemagick命令

c++ run imagemagick command

本文关键字:命令 imagemagick 运行 c++      更新时间:2023-10-16

我想在后台执行imagemagik命令,而不是使用ShellExecute或ShellExecuteEx显示窗口控制台,但无法获得输出文件。

ShellExecuteEx(0, _T("open"), _T("D:/convert.exe"),
               _T("convert clipboard:myimage test.png"), NULL, SW_HIDE)

这与其说是一个答案,不如说是一条评论。如果您已经在编写c++应用程序,为什么不将Magik++库包含到您的项目中呢?

#include <Magick++.h>
// ...
Magick::Image img("clipboard:myimage");
img.write("test.png");
// ...

如果你写了ShellExecuteEx,我假设这是Windows?

请参阅如何在不显示Win32 GUI程序的控制台窗口的情况下执行子控制台程序?