c++ - 使用 ImageMagick++ 捕获 X11 屏幕截图

标签 c++ imagemagick x11

我如何使用 ImageMagick++ 在 C++ 中轻松截取 X11 屏幕的屏幕截图,类似于“导入”命令?

最佳答案

使用来源,卢克。如果在 ImageMagick++ 中找不到它,请回退到它的依赖项。您要查找的代码在 ImageMagick/wand/import.c 中:

%  ImportImageCommand() reads an image from any visible window on an X server
%  and outputs it as an image file. You can capture a single window, the
%  entire screen, or any rectangular portion of the screen.  You can use the
%  display utility for redisplay, printing, editing, formatting, archiving,
%  image processing, etc. of the captured image.</dd>

如果您不想将其写入文件,则必须自己弄清楚代码在做什么。这似乎是代码中执行可访问 X11 显示的实际捕获的唯一位置,因此这是您的起点。

关于c++ - 使用 ImageMagick++ 捕获 X11 屏幕截图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4089320/

相关文章:

c++ - 在 C++ 中覆盖具有不同返回类型的方法

C++20 概念测试在 MSVS 16.5 中不起作用

linux - 如何使用 ImageMagick 控制 PDF 纸张大小?

PHP ImageMagick - readimage 不适用于某些 pdf

java - 我可以从同一个 JVM 渲染到多个显示器吗?

c++ - 如何通过引用传递对象以供另一个文件使用

c++ - "Call of overloaded FUNCTION is ambiguous"(转换构造函数 C++)

php从一串图片内容中获​​取图片大小

c++ - 在 GPU 上使用 X11 时,XShmGetImage 是否会返回主机/设备内存?

c - 在 x11 中记录多个按键