HPlogo Using the X Window System > Chapter 10 Printing and Screen Dumps

Making and Displaying Screen Dumps

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

X11 windows can be dumped into files by using the xwd client. The files can be redisplayed on the screen by using the xwud client.

Making a Screen Dump with `xwd'

The xwd client allows you to take a "picture" of a window that is displayed on the screen and store it in a file. The filed picture can then be printed, edited, or redisplayed. You select the window to be dumped either by clicking the mouse on it or by specifying the window name or id on the command line.

The resulting file is called an xwd-format bitmap file or an xwd screen dump. All of the figures used in this manual are xwd screen dumps.

The syntax for xwd is as follows:

   xwd [options]

where options are:

-help

Provides a brief description of usage and syntax.

-id id

Specifies the window to be dumped by its id rather than using the mouse to select it.

-add

Adds value to every pixel.

-name name

Specifies the window to be dumped by its name rather than using the mouse to select it.

-root

Specifies that the window to be dumped is the root window.

-add value

Add value to every pixel. value is signed.

-nobdrs

Dumps the window without borders.

-out filename

Specifies that the screen dump is to be stored in the file filename.

> filename

Specifies that the screen dump is to be stored in the file filename.

-xy

Selects `XY' format of storage instead of the default `Z' format.

-display display

Specifies the screen that contains the window to be dumped.

This first example stores a window in a file named savewindow, using the pointer to determine which window you want.

  1. Display an hpterm or xterm window.

  2. Type:

       xwd -out savewindow Return
    
    The pointer changes shape, signifying you can select a window to dump.

  3. Move the pointer into the window you want to dump. Press and release any pointer button. After the image is captured, the cursor changes back to its normal shape and the window is stored in the file savewindow.

If you know the name of the window you want to dump, you don't need to use the pointer at all. This example dumps the window named "calendar" to a file named calendar.dump.

   xwd -name calendar -out calendar.dump Return

Displaying a Stored Screen Dump with `xwud'

The xwud client allows you to display an xwd-format file on your monitor. You could have created the file earlier with xwd or translated it from another format into xwd format.

NOTE: The image to be restored has to match the depth of the display on which it is to be restored. For example, an image created and stored using a depth of four cannot be restored on a display with a different depth.

The syntax for xwud is as follows:

   xwud [options]

where options are:

-help

Displays a brief description of the options.

-in filename

Specifies the file containing the screen dump.

-inverse

Reverses black and white from the original monochrome dump.

-display host:display.screen

Specifies the screen on which to display the dump.

This example displays the xwd-format file myfile.

   xwud -in myfile Return
© 1995 Hewlett-Packard Development Company, L.P.