使用Python调用ImageMagick的“导入”
我想使用 ImageMagick 从 Python 脚本捕获应用程序窗口的屏幕截图,就像从 shell 中使用 ImageMagick 的“导入”命令一样。来自 Python 的 API 调用或系统调用(如“subprocess.Popen([“import”...”))就足够了,但我不想在硬盘上创建文件。我的操作系统是 Linux。
I want to capture a screenshot of an application's window from a Python script using ImageMagick, as I would with ImageMagick's "import" command from a shell. An API call or a system call from Python (as in "subprocess.Popen(["import"...") will suffice, but I don't want to create a file on the hard drive. My OS is Linux.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
执行命令:
这将导致
import
输出到 stdout。您还可以将
png
更改为此处。Execute the command:
This will cause
import
to output to stdout.You can also change
png
to one of the type tags shown here.