Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!ZERMATT.LCS.MIT.EDU!RWS From: RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) Newsgroups: comp.windows.x Subject: inverting areas Message-ID: <19880518120052.7.RWS@KILLINGTON.LCS.MIT.EDU> Date: 18 May 88 12:00:00 GMT References: <324@piring.cwi.nl> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 20 Date: 17 May 88 16:25:32 GMT From: mcvax!guido@uunet.uu.net (Guido van Rossum) 1) is it kosher to retrieve the fg and bg pixels using gc->values? No. The GC structure is supposed to be opaque, and is not guaranteed to be identical in all implementations. (if not, what is in general the recommended way to get a value out of a GC?) In the C Xlib, there is no way. You must remember values yourself. (In the CommonLisp interface, it is possible to extract values.) 2) is this the recommended way to do "invert" an area? It is one perfectly good way for monochrome images. An alternative is to use function GXxor, and use a "foreground" value that is the XOR of the foreground and background pixel values. Which method is faster will depend on the server implementation.