Re: xlib transparent icons



John Smith staggered into the Black Sun and said:
I've been trying to set a window's icon from an array of ARGB quads.
So far, I've come up with the following

x_image = XCreateImage(g_display, CopyFromParent, 24,
ZPixmap, 0, bytes, 16, 16, 32, 0);
icon_pixmap = XCreatePixmap(g_display, sw->wnd, 16, 16, 24);
XPutImage(g_display, icon_pixmap, g_gc, x_image, 0, 0, 0, 0, 16, 16);

Are you writing a WM or a widget set? I thought that GTK+ and Qt had
easier ways of doing this sort of thing.

That works (though it's probably not the most elegant way of doing
things and it's hard-coded to only work for a 16x16 image), but I've run
into a block with transparency. I can't figure out how to set pixels to
be transparent - they're just coming up black.

"man XeviGetVisualInfo" may provide a useful function for asking the X
server about transparency and how to draw transparent pixels.

--
You have me mixed up with more creative ways of being stupid.
--MegaHAL, trained on random gibberish
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
.