Path: utzoo!attcan!uunet!samsung!emory!nastar!joel From: joel@nastar.UUCP (Joel Rives) Newsgroups: comp.windows.x Subject: Re: Transparent Pixel values Keywords: Pixmap, Window, Pixels Message-ID: <633@nastar.UUCP> Date: 6 Nov 89 19:11:58 GMT References: <809@thor.wright.EDU> <9692@zodiac.ADS.COM> Reply-To: joel@nastar.UUCP (Joel Rives) Organization: Digital Transmissions Systems, Inc. Lines: 21 >medmunds@verity.com (Mike Edmunds x7645) (medmunds@verity.com, <9692@zodiac.ADS.COM>): >I've had some success with setting the clip_mask in a GC to a bitmap >with objects drawn on it, and then painting through this "stencil" >using XFillRectangle over the entire area. Only pixels that were set >in the bitmap are affected in the destination window. If your >original pixmap was more than one plane deep, you'll have to separate >it into components (I keep a separate bitmap for each color) and paint >multiple times. According to the "Xlib -- C Language Interface", the XCopyArea() function uses the clip-mask component of the GC specified in the call. I have used this feature to restrict displaying of a pixmap to a rectangular sub-region. There is no reason that i can see why one could not use the stencil method that Mike mentions. However, instead of using multiple calls to XFillRectangle(), simply make one call to XCopyArea(). The bitmap clip-mask does not restrict the copy function to a single plane. It merely determines which pixels will be copied and which will be filtered out. Joel Rives