问题
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...)
回答1:
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:
PyGTK sample
Windows and DirectX samples
来源:https://stackoverflow.com/questions/1276616/take-screenshots-quickly-from-python