Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!decwrl!ucbvax!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: Bitmap -> Pixmap operation Message-ID: <9008100624.AA26553@Larry.McRCIM.McGill.EDU> Date: 10 Aug 90 06:24:56 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 37 > I have a Bitmap (single plane Pixmap) and an eight plane Pixmap. I > want to stamp the Bitmap onto the Pixmap so that any off locations in > the Bitmap don't change the Pixmap and any on locations in the Bitmap > set that location in the Pixmap to a specific value (i.e. 254). Is > there an easy X way to do this? Create a GC appropriate to the 8-plane pixmap; set its components as follows: stipple = the bitmap fill-style = FillStippled foreground = 254 (or whatever the specific value is) Then use XFillRectangle to fill the whole pixmap with this GC. (I assume the origins are to be identified with one another; if this is not true you need to set the tile/stipple origin in the GC.) Alternatively, set clip-mask = the bitmap fill-style = FillSolid foreground = 254 Then use XFillRectangle just as before. Which is more efficient? I don't know; it depends on your server. The semantics are the same only under certain circumstances which I don't feel up to working out in all their gory detail. But if no part of the pixmap extends outside the bitmap, the semantics are identical, at least as far as I understand them. (One obvious semantic difference is that if the bitmap is smaller than the pixmap, the first method given replicates it; the second doesn't.) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu