# To select an area of the screen with the mouse import figure.eps
# To select an area of the screen with the mouse import figure.eps
# an X window with frame import -frame app-snap.jpg
# To capture the entire X server screen import -window root root.jpeg
Import reads an image from any visible window on an X server and out- puts it as an image file. You can capture a single window, the entire screen, or any rectangular portion of the screen. Use display for redisplay, printing, editing, formatting, archiving, image processing, etc. of the captured image.
The target window can be specified by id, name, or may be selected by clicking the mouse in the desired window. If you press a button and then drag, a rectangle will form which expands and contracts as the mouse moves. To save the portion of the screen defined by the rectan- gle, just release the button. The keyboard bell is rung once at the beginning of the screen capture and twice when it completes.
Usage: import [options ...] [ file ]
Where options include:
-border include image borders in the output image -frame include window manager frame
-crop geometry preferred size and location of the cropped image -geometry geometry perferred size or location of the image -page geometry size and location of an image canvas
-comment string annotate image with comment -label name assign a label to an image -limit type value Area, Disk, Map, or Memory resource limit -window id select window with this id or name
-interlace type None, Line, Plane, or Partition -monochrome transform image to black and white -negate replace every pixel with its complementary color
-pointsize value font point size -quality value JPEG/MIFF/PNG compression level -resize geometry resize the image -rotate degrees apply Paeth rotation to the image
-snaps value number of screen snapshots -pause value seconds delay between snapshots
documented on: 2005.02.27
Newsgroups: comp.os.linux.x Date: 4 Apr 2003 02:36:07 GMT
> How to make a screenshot with the mouse pointer in it? I tried xwd, > gimp, ... None of the images they dumped have a mouse pointer in it.
This is, ironically, a feature. Modern X servers use modern videocards' "hardware cursor" functionality unless you specifically tell them not to. This means the cursor is kept in a special block of video memory and not the main framebuffer. This makes drawing the cursor and moving it around much faster than it would be otherwise. However, the XGetImage() call executed on the root window doesn't return the block of video memory that contains the cursor, just the main framebuffer.
Don't know what to say here… you might try fiddling with your /etc/X11/XF86Config file by going to the Device section and entering the line
Option "HWCursor" "off"
me. I don't know, the easiest thing to do is probably to paint the cursor in again using Gimp if you really need it. FWIW, I haven't been able to take a screenshot in Windows with the cursor in it either—only system where the cursor is always in screenshots that I've seen is MacOS before OS X.
Matt G
Another possibility is to use an X server that writes into a virtual frame buffer. Xvfb or Xvnc sping to mind. I'd try using Xvnc to serve the app involved, then use a vncviewer (being careful to turn off cursorshape if the viewer supports it), then grab the resulting screen image, which should have a cursor in it. Xvfb is more difficult to interact with, which is why I'd use Xvnc for this purpose.
Mind you: capture from the outer server, not the Xvnc directly; often things are set up so that XGetImage doesn't include the cursor, even when the server is writing on a virtual frame buffer.
Wayne Throop