Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!snorkelwacker.mit.edu!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: <9103260339.AA04253@lightning.McRCIM.McGill.EDU> Date: 26 Mar 91 03:39:19 GMT Sender: tytso@athena.mit.edu (Theodore Y. Ts'o) Organization: The Internet Lines: 38 >> [An application which displays image data in a window (actually a >> pixmap which is then copied to the window upon exposure) and then >> draws some lines and text over the image. When the image changes, >> is there any way to avoid having to recompute/redraw the text and >> lines which are independant of the image data?] >> - We have thought about have text/lines in one Pixmap and the image >> in another Pixmap and then combining them together [...]. > What you can do is have a pixmap for the image data. Also have a > _bitmap_ (a 1 bit deep pixmap) into which you will draw the text and > lines. To get the image & text/lines into a window you use > XCopyArea() to copy the image data from the pixmap and then use > XCopyPlane() to copy from the bitmap into the window. The GC used in > XCopyPlane() should: > o Have the clipmask set to the bitmap which is the source of > the XCopyPlane() call. If you do that, you don't need to XCopyPlane(); you can XFillRectangle() instead. Note that you need to reset the clip-mask every time, if you've drawn into it since you last set it; you can't depend on the GC noticing changes you make to the bitmap after you set it as the clip-mask. The original poster also said (in text I've deleted) that they're using colormap cells 0-8 for annotations. This implies more than one bit's worth of annotations. Possibilities: keep a separate bitplane for each color of annotation, which you suggested, or perhaps keep a pixmap for annotations and then XCopyArea() it using your notion of an appropriate clip-mask in the GC. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu