[python-win32] screen capture and win32gui.GetDesktopWindow()

Ray Schumacher rays at blue-cove.com
Thu Dec 7 01:32:46 CET 2006


I've been mulling screen capture code. I tried PIL's 
ImageGrab().grab() (with pymedia) but find PIL's method to be pretty 
slow, ~4grabs per second max with no other processes.
pymedia is pretty quick once I hand it the data.

There has to be another way to get a copy or buffer() of the screen 
DC's data that is faster (I hope).

I putsed around with win32gui
desktop = win32gui.GetDesktopWindow()
dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop)
but couldn't see how to get at the data via the handle.

I've read that ctypes can directly access data by constructing 
POINTER objects, but I didn't try it.

suggestions?

Ray



More information about the Python-win32 mailing list