Re: pixmaps and xpm-transparency



In message <20010417173325 A1729 phoenix vulkan priv>you write:
>hi,
>
>i've some problems with transparency of XPMs using pixmaps.

X (pre-XRender extension) doesn't support this kind of
operation in the way you are thinking about.

the first problem is that the color used for the "transparent"
parts is determined by the colormap you provided when you created the
pixmap. gRootWindow is not likely to be a good choice.

but it doesn't matter that much anyway, since it doesn't help
you. that would simply set all transparent pixels within the
*rectangular* area of the small pixmap's window to the same
color. remember, X does not support opaqueness (pre-XRender). if what
is "underneath" these pixels is not that color, you don't get the
effect you want at all.

what you need is a non-rectangular window, which means that you need
to use gtk_widget_shape_combine_mask. this will adjust a widget's
shape by using a mask. you can use the same mask as was generated when
you created the pixmap, and the result is that all areas marked as
"transparent" in the XPM are "removed" from the widget's outline
shape. 

see the "shape" example in gtktest.c for more details. 

--p






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]