Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!dont-send-mail-to-path-lines From: mouse@lightning.mcrcim.mcgill.EDU (der Mouse) Newsgroups: comp.windows.x Subject: Re: Remembering Graphics Message-ID: <9103230541.AA03161@lightning.McRCIM.McGill.EDU> Date: 23 Mar 91 05:41:06 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 41 > We have 16 bit grayscale images that we sample down to 8 bit images > based on a particular (and changable) window/level setting into a > Pixmap that is then CopyArea'd onto a Window. All graphics > (text,lines etc..) are drawn into the Pixmap and then re-CopyArea'd > onto the window. This enables taking care of Expose events for those > windows that have images and graphics. > Our problem is when we re-sample the 16 bit image into the Pixmap > (which is often and can occur almost anywhere in our program) all of > the text/lines are then gone [...]. [8-bit PseudoColor hardware] > - We do not want to limit the number of bits in the colormap by, say, > 1 bit and use plane masks [...]. > - We have thought about have text/lines in one Pixmap and the image > in another Pixmap and then combining them together when a window is > Exposed. You could keep a bitmap that is, say, 0 where the image is to appear and 1 where the annotations are to appear, then keep two pixmaps, one for the picture and one for the annotations, using the bitmap as a clip-mask when copying things to make sure you don't destroy more than you want to. If you are willing to require the server to support SHAPE (not unreasonable IMO) and the annotations don't change often, you could keep them in a separate window, shaped to fit them precisely, thus sidestepping the problem entirely. You could put the image in the window's background pixmap, then draw the annotations as graphics; then the server deals with refreshing the image for you, and you just need to redraw the annotations on expose. There are probably other ways, but those are all that come to mind right now. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu