Efficient Screen Capture

jason cipriani jason.cipriani at gmail.com
Wed Dec 20 09:48:17 PST 2006


How do I capture the contents of the screen in less than 10 seconds?

The following code is entirely too inefficient to be useful:

Display *disp = XOpenDisplay(NULL);
Window win = XRootWindow(disp, XDefaultScreen(disp));
XImage *image = XGetImage(disp, win, 0, 0, WIDTH, HEIGHT, ~0, XYPixmap);

I'm willing to hack it pretty far so any ideas (such as direct copies
from video memory) would be useful. I am not willing to use any
hardware other than this machine.

Also just to make sure, is ~0 a sane value for plane_mask with format XYPixmap?

Thanks,
Jason



More information about the xorg mailing list