[xlib] howto create screenshots?

Clemens Eisserer linuxhippy at gmail.com
Fri Sep 16 12:16:09 PDT 2005

Hi again, 

> The whole point of that 25-field XWDFileHeader structure is to specify
> the format of what follows (for colour-mapped data, there will be a
> colour palette as well as the pixel data).
> Given the wide variety of formats which can be used, you will probably
> want to look at the code from some existing tool, e.g. xwdtopnm from
> the netpbm package.

Thanks a lot for all the tips, I now use a specially tuned version of
netpbm's xwdtopnm-converter where I just do not use the pnm-creating
I identified that fileio seems to be a real bottleneck so I want to
use Xvfb's "-shmem"-Option to read out the framebuffer instead of
going through fread to access the memory-mapped framebuffer-file.
However one questions remains: For shmget I need to specify a size (do
I really need to?), at least the parameter list says so, but how can I
get the size of the framebuffer?
Is there any way to do this automatic, or is the size argument ignored
at all when connection to an already created shared memory segment?

Thank you in advance, lg Clemens

More information about the xorg mailing list