XImage Transparency

Juliusz Chroboczek Juliusz.Chroboczek at pps.jussieu.fr
Thu Jul 26 15:21:18 PDT 2007


>> How can you make part of an XImage transparent (true transparency - as
>> in I can see something under the transparent parts) ? 

> You can't.

> If you want to plot a "masked" image, you need a separate mask bitmap,
> where 1 represents opaque and 0 represents transparent.
>
> First, the mask needs to exist as a 1-bit Pixmap. You can then set
> this as the clip mask using XSetClipMask() and XSetClipOrigin(). When
> you draw the image (XPutImage), it will be masked against the clip
> mask.

And watch your X server collapse.

If you use XSetClipMask, the bitmap will be converted to a set of
spans, which will kill performance.

Instead, you should be using the Render extension together with RGBA
images.

                                        Juliusz



More information about the xorg mailing list