(Answer) (Category) Linux on PowerPC FAQ-O-Matic : (Category) X Windows :
How can I get an X window dump in TIFF, GIF, etc?
The shareware program xv can "grab" a window. From xv, you can create a graphics file, and save it under the many formats that xv can generate.

The "built-in" xwd (/usr/X11R6/bin/xwd - part of X11's standard distribution) is X window dump. It writes to standard output a graphics dump of a selected window in the xwd graphics file format.

From package libgr-progs-2.0.13-4b.ppc.rpm, /usr/bin/xwdtopnm translates an xwd file as standard input to a pnm file as standard output. Then, for example, there is pnmtotiff which translates pnm to tiff, and ppmtogif which translates ppm to gif.

So, to generate a gif dump of a window, at a shell prompt, do:

     xwd | xwdtopnm | ppmtogif > dump.gif

xwd then gives crosshairs. Click on a window, and you'll get a gif dump in dump.gif.

For more info, check man on: xwd xwdtopnm ppmtogif pnmtotiff - and others.


There is a much better way to do it than this. The command line tool "import" will do the same thing with much the same options but will save to any one of about a million different file formats. Simply do:
        import -window root root.jpeg
to get an image of the root window in jpeg format. Or you could do:
        import image.eps
to get an image of a window you click on into encapsualted postscript etc, etc ad nauseam. Check the manpage for details :)
[Append to This Answer]
Previous: (Answer) How do I choose another windowmanager instead of KDE?
Next: (Answer) Accelerated X!!
This document is: http://www.jonh.net/cgi-bin/lppcfom/fom?file=503
[Search] [Appearance]
This is a Faq-O-Matic 2.717d.
Hosted by anduin.org and SourceForge Logo