XImage Transparency

Glynn Clements glynn at gclements.plus.com
Thu Jul 26 13:26:22 PDT 2007


Gheorghe, Gelu wrote:

> 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.

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list