Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.windows.x Frequently Asked Questions (FAQ) 7/7
Section - 168) Why do I get a BadMatch error when calling XGetImage?

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Forum archive ]


Top Document: comp.windows.x Frequently Asked Questions (FAQ) 7/7
Previous Document: 167) What's this R6 error: X Toolkit Error: NULL ArgVal in XtGetValues?
Next Document: 169) How can my application tell if it is being run under X?
See reader questions & answers on this topic! - Help others by sharing your knowledge

The BadMatch error can occur if the specified rectangle goes off the edge of 
the screen. If you don't want to catch the error and deal with it, you can take
the following steps to avoid the error:

1) Make a pixmap the same size as the rectangle you want to capture.
2) Clear the pixmap to background using XFillRectangle.
3) Use XCopyArea to copy the window to the pixmap.
	[Whoa! this answer is currently under reexamination.]
4) If you get a NoExpose event, the copy was clean. Use XGetImage to grab the
image from the pixmap.
5) If you get one or more GraphicsExpose events, the copy wasn't clean, and 
the x/y/width/height members of the GraphicsExpose event structures tell you 
the parts of the pixmap which aren't good.
6) Get rid of the pixmap; it probably takes a lot of memory.

[10/92; thanks to Oliver Jones (oj@pictel.com)]

User Contributions:

Comment about this article, ask questions, or add new information about this topic:




Top Document: comp.windows.x Frequently Asked Questions (FAQ) 7/7
Previous Document: 167) What's this R6 error: X Toolkit Error: NULL ArgVal in XtGetValues?
Next Document: 169) How can my application tell if it is being run under X?

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
faq%craft@uunet.uu.net (X FAQ maintenance address)





Last Update March 27 2014 @ 02:12 PM