快速地从python截取屏幕截图 [英] Take screenshots **quickly** from python

查看:923
本文介绍了快速地从python截取屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

A PIL.Image.grab()大约需要0.5秒.只是将数据从屏幕上获取到我的应用程序,而无需我进行任何处理.另一方面, FRAPS 最多可以截取30 FPS的屏幕截图.有什么办法可以让我从Python程序执行相同的操作吗?如果不是,那么从C程序开始呢? (我可以将它与Python程序连接起来,可能...)

A PIL.Image.grab() takes about 0.5 seconds. That's just to get data from the screen to my app, without any processing on my part. FRAPS, on the other hand, can take screenshots up to 30 FPS. Is there any way for me to do the same from a Python program? If not, how about from a C program? (I could interface it w/ the Python program, potentially...)

推荐答案

如果要快速截图,则必须使用较低级别的API,例如DirectX或GTK.有适用于这些应用程序的Python包装器,例如 DirectPython

If you want fast screenshots, you must use a lower level API, like DirectX or GTK. There are Python wrappers for those, like DirectPython and PyGTK. Some samples I've found follow:

Windows和DirectX示例

这篇关于快速地从python截取屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆