Peter Harris wrote:

> > but xlib doesnt support an alpha channel (and the freerunner has only 16
> > bits per pixel). is there an easy way to do transparency (one
> > transparent color is enough) with xlib or a toolkit which builds on it?
> 
> If you can easily extract that color into a 1-bit bitmap, you can use
> XSetClipMask.

Alternatively, you can do it in two steps:

        XSetFunction(dpy, gc, GXandInverted);
        XSetBackground(dpy, gc, 0UL);
        XSetForeground(dpy, gc, ~0UL);
        XCopyPlane(dpy, mask, win, gc, ..., 1UL);
        
        XSetFunction(dpy, gc, GXor);
        XCopyArea(dpy, image, win, gc, ...);

The image must have all background (transparent) pixels set to zero.

Also, you can use XPutImage() instead of XCopyPlane() and XCopyArea().

-- 
Glynn Clements <gl...@gclements.plus.com>
_______________________________________________
xorg@lists.freedesktop.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.freedesktop.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com

Reply via email to