使用Python来调用ImageMagick的“import” [英] use Python to call ImageMagick's "import"
本文介绍了使用Python来调用ImageMagick的“import”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用ImageMagick从Python脚本捕获应用程序窗口的屏幕截图,就像我从ImageMagick的shell中的import命令一样。来自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.
推荐答案
执行命令:
import png:-
这将导致 import
输出到stdout。
This will cause import
to output to stdout.
您还可以将 png
更改为这里。
这篇关于使用Python来调用ImageMagick的“import”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文