Table of Contents

Name

xsnap - Take a snapshot of a region of the screen

Synopsis

xsnap [-display displayname] [-bg bgcolor] [-fg fgcolor] [-bd bordercolor] [-bw borderwidth] [-geometry geometry] [-icongeometry icongeometry] [-region geometry] [-iconic] [-name title] [-nograb] [-jpg] [-png] [-pnm] [-ppm] [-xpm] [-xwd] [-dump] [-file name] [-stdout] [-show] [-hide]

Description

The xsnap program allows one to take a snapshot of a specified region of the screen. If xsnap is run without a region being specified, the user is prompted to interactively drag one out with the mouse. In this case, pressing button 1 will select one corner of the region, and an opposite corner will be selected upon the release of button 1. Pressing button 2 selectsthe whole window, while pressing button 3 cancels the selection. A special case is when a region of zero with and height is selected with button 1. In that case, the selection is the last subwindow (in the hierarchy of subwindows) which contains the selected point. Once the region is selected, a window whose contents are a copy of this region is created, and various actions can be taken through key bindings (upper or lower case is irrelevant).

Pressing "q" or "Esc" in the xsnap window will exit the program, and pressing '!' restarts a new instance. The captured region may also be stored to a file for later use, by pressing 'j', 'g', 'n', 'p', 'x' or 'w', while key 'z' enables/disables compression.

Here 'j' stands for *.jpg format, 'g' for *.png format, 'n' for *.pnm.gz (ascii PPM), 'p' for *.ppm.gz (raw PPM), 'x' for XPixmap format (*.xpm.gz) and 'w' for XWindow Dump format (*.xwd.gz). Except for PNG which is already compressed, all other formats are automatically gzip compressed since this saves a lot of disk space. However, compression is not performed if the image data are dumped to stdout (-stdout option).

All other keys raise the dialog window if it is not yet open, and have no effect otherwise.

This program is a strongly enhanced variant of the original xsnap program by Clauss Strauch.

Options

-display display
Specifies the display to use for both specifying and displaying the region.
-bg bgcolor
Background color of dialog window. Defaults to #EEEEE6 (light grey).
-bd fgcolor
Foreground color of dialog window. Defaults to black.
-bd bordercolor
Border color of snapshot window. Defaults to white.
-bw border width
Border width of snapshot window. Defaults to 2.
-geometry geom
Geometry of snapshot window.
-icongeometry geom
Geometry of icon.
-iconic
If specified, snapshot window will start up in iconic state.
-name title
Name of the window to be passed to window manager.
-nograb
Do not grab the server during specification of region.
-jpg
Store the image in JPG format.
-png
Store the image in PNG format.
-pnm
Store the image in PNM format (=ascii PPM), as a compressed *.pnm.gz file (compression is not performed when outputting to stdout).
-ppm
Store the image in PPM format (raw data), as a compressed *.ppm.gz file (compression is not performed when outputting to stdout).
-xpm
Store the pixmap in X PixMap Format, as a compressed *.xpm.gz file (compression is not performed when outputting to stdout).
-xwd
Store the pixmap in X window dump format, as a compressed *.xwd.gz file (compression is not performed when outputting to stdout).
-dump
Dump to a file (default file is $HOME/snapXXXX.<format> if no root name has been specified). XXXX is a number in the range 0000..9999 selected in such a way that the resulting file does not exist yet.
-file name
Store the output in the file name.<format>, where <format> is the appropriate suffix derived from the selected format. Only the root name of the file should thus be given. The file gets overwritten if it already exists, so take care...
-stdout
Write the image data to stdout (in the specified format, uncompressed).
-show
Display the image in a window (this is the default).
-hide
Do not display the image in a window. This results in getting the data to be dumped to file, i.e. -dump is turned on automatically.
-region geom
The size and location on the screen of the region to be copied.

Bugs


In PseudoColor mode, colormaps are supported only in case an entire window is captured by clicking with the first or second buttons. Incorrect behavior may result on displays that support windows of different depths, or when the window carries elements which have different colormaps.
Since it creates a pixmap for each snapshot, it can chew up server memory very fast. In this perspective, it can be useful to use to option '-convert gzip' to compress the files on the fly.
The icongeometry option doesn't know about icon sizes.

Authors

Original version: Clauss Strauch
Engineering Design Research Center

Carnegie Mellon University

2nd version (xwd, atk, region options added):
Bill Janssen

Xerox Palo Alto Research Center

3rd version (region option fixed, XPM option added):
Arnaud Le Hors

Bull Research France

millenium version (colormap support, new image formats PNG, PNM, PPM, conversion of image formats on the fly, save procedure, GUI dialog; obsolete atk format removed):
Jean-Pierre Demailly

Université de Grenoble I


Table of Contents