Xwd
Encyclopedia
In the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

, xwd is a program
Computer program
A computer program is a sequence of instructions written to perform a specified task with a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute...

 for capturing the content of the screen or of a window
Window
A window is a transparent or translucent opening in a wall or door that allows the passage of light and, if not closed or sealed, air and sound. Windows are usually glazed or covered in some other transparent or translucent material like float glass. Windows are held in place by frames, which...

 and saving it into a file
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

.
xwd can be run in two ways: if user specifies the whole screen or the name or identifier of a window as an argument, the program captures the content of the window; otherwise, it changes the shape of the cursor
Cursor (computers)
In computing, a cursor is an indicator used to show the position on a computer monitor or other display device that will respond to input from a text input or pointing device. The flashing text cursor may be referred to as a caret in some cases...

 and waits for the user to click in a window, whose content is then captured.

At the X Window core protocol
X Window core protocol
The X Window System core protocol is the base protocol of the X Window System, which is a networked windowing system for bitmap displays used to build graphical user interfaces on Unix, Unix-like, and other operating systems...

 level, xwd uses the fact that any X client can request the content of an arbitrary window, including ones it did not create, using the GetImage request (this is done by the XGetImage function in the Xlib
Xlib
Xlib is an X Window System protocol client library written in the C programming language. It contains functions for interacting with an X server. These functions allow programmers to write programs without knowing the details of the protocol...

 library). The content of the whole screen is obtained by requesting the content of the root window
Root window
In the X Window System, every window is contained within another window, called its parent. This makes the windows form a hierarchy. The root window is the root of this hierarchy...

.

The file generated by xwd can then be read by various other X utilities such as xwud, xv
Xv
xv is a shareware program written by John Bradley to display and modify digital images under the X Window System.While popular in the early 1990s , no official releases have been made since December 1994...

, and the GIMP
GIMP
GIMP is a free software raster graphics editor. It is primarily employed as an image retouching and editing tool and is freely available in versions tailored for most popular operating systems including Microsoft Windows, Apple Mac OS X, and Linux.In addition to detailed image retouching and...

, or converted to other formats; the netpbm
Netpbm
Netpbm is an open source package of graphics programs and a programming library, used mainly in the Unix world. It is a highly portable package, working under many Unix platforms, Windows, Mac OS X, VMS, Amiga OS and others and is included in all major open source Unix-like operating system...

 suite allows a useful pipeline to be constructed:
$ xwd | xwdtopnm | pnmtopng > Screenshot.png

The dumps are larger in size than files in most image file formats – not only compressed formats such as PNG, but also uncompressed bitmap formats like BMP.

External links

  • xwd manual page
  • xwud manual page
  • xwd is part of X11
    X Window System
    The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

    's standard distribution, but its source
    Source code
    In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

    can also be downloaded separately as [ftp://ftp.x.org/pub/current/src/app/xwd-1.0.4.tar.bz2 tar.bz2] or [ftp://ftp.x.org/pub/current/src/app/xwd-1.0.4.tar.gz tar.gz]
  • File::XWD Perl package at CPAN
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK