Newsgroups: comp.windows.x
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines
From: mouse@lightning.mcrcim.mcgill.EDU (der Mouse)
Subject: Re: XGetImage, BadMatch
Message-ID: <9105021330.AA18212@lightning.McRCIM.McGill.EDU>
Sender: daemon@athena.mit.edu (Mr Background)
Organization: The Internet
Date: 2 May 91 13:30:34 GMT
Lines: 29

> i also seem to get BadMatch errors if part of the image i'm trying to
> get is off the screen.  works fine if all of it is on screen.

> u might have to check for the window's width and height then.

The Xlib document says:

	If the drawable is a pixmap, the given rectangle must be wholly
	contained within the pixmap, or a BadMatch error results.  If
	the drawable is a window, the window must be viewable, and it
	must be the case that if there were no inferiors or overlapping
	windows, the specified rectangle of the window would be fully
	visible on the screen and wholly contained within the outside
	edges of the window, or a BadMatch error results.

There's more, but that's all that talks about BadMatch errors.  The
protocol document contains similar language.

So yes, if the window is partly off-screen, you can't XGetImage the
off-screen portion, and this is not a bug.  Note that you can use
XGetImage to fetch portions that are on-screen but behind other
windows, but unless the server is maintaining backing-store for the
window, the bits you get are undefined and typically will be those of
the obscuring window.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu
