What features can I use to take a screenshot of the X11 desktop using the Xlib library? I would prefer a method that is more efficient than getting individual pixels. Thank.
The standard tool for taking screenshots in X11 is to use
xwd -root > myscreen.xwd
Then convert to .pnm with
xwd2pnm myscreen.xwd > myscreen.pnm
Therefore, you can find the xwd source code and see how it is implemented, http://cvsweb.xfree86.org/cvsweb/xc/programs/xwd/xwd.c?rev=HEAD&content-type=text/vnd.viewcvs-markup