Re: alpha translucent image



Yes, this oft-requested feature can be accomplished in one of two ways:
1) the "correct" way using Xft/XRender directly.  This is an ugly hack
that, well, won't (always) work if you use a gtk_window, but can be made
to work if you use gdk_window, etc. directly.  I'm not going to go into
any more detail here because, well, it's what amounts to an "ugly hack"
and while I did get it to work in a test app, it uses "unofficial" gdk
functions (gdk_drawable_get_internal_info or similar) and an
expose_event handler.
This method will actually get everything beneath the window, whatever
they may be, but, like I said, it's a hack.

2) the "clean" way involves using EggBackgroundMonitor (or writing your
own, similar, program) to get the background image underneath your
widget and then drawing that image at some alpha.  This only gives you
the background image under your window, rather than everything, but it's
much simpler, easier, and cleaner.

This is a very often requested feature and one that would be nice to see
implemented in the "one true method" (dragging the Xft/Xrender
operations down to the gdk_draw and gdk_rgb(a) level and into the guts
of gdk) but there are a number of, ah, difficulties with that method, a
large one being (if I remember correctly) ABI and API compatibility,
meaning this would be a Gtk+ 3.0 level change.

--Shahms


On Fri, 2002-09-27 at 12:13, alennartsson ICTV com wrote:
Hi,

I am using gtk 2.0.4.

I am trying to have an alpha translucent image (like the alphatest.png in
gtk-demo) on a "GTK_WINDOW_POPUP". I want the "GTK_WINDOW_POPUP" window to
be alpha translucent (I want to see the desktop or whatever app that is
behind through the translucent image).

I have tried to use gdk_pixbuf_render_pixmap_and_mask to get the bitmap
mask.
and gtk_widget_shape_combine_mask () for my "GTK_WINDOW_POPUP" window.
It looks like gdk_pixbuf_render_pixmap_and_mask does not support alpha
translucency (I have to set an alpha_threshold). So, I could not get it to
work.
Does anyone know of a way to accomplish this?

Thanks,

Andreas.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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