Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!bbn!apple!bloom-beacon!EXPO.LCS.MIT.EDU!jim From: jim@EXPO.LCS.MIT.EDU (Jim Fulton) Newsgroups: comp.windows.x Subject: Re: Reverse-Video Message-ID: <8902271639.AA01116@expo.lcs.mit.edu> Date: 27 Feb 89 16:39:06 GMT References: <8902271458.AA29264@expo.lcs.mit.edu> Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 15 > Could anyone tell me whether there is an easy way in Xlib to > reverse-video a window and reverse back again? Depends on what you mean by "reverse". If the area in the window only has two pixel values, you can use a filled rectangle with a GC that has the following fields: function: GXxor foreground: (firstpixelvalue ^ secondpixelvalue) If you have a more complicated image on the screen, you'll have to look into allocating color planes (make sure you have a dynamic visual...) and setting up the color cells so that the arithmetic works out.