Screenshots in X11

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.

+3
source share
1 answer

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

+6
source

All Articles