Re: How to set a transparent style?



> From: Paul Davis <pbd op net>
>
> >> From: <hunchback netcabo pt>
> >>
> >> Hi, 
> >>
> >> i'm doing something that involves GtkDrawingArea, in which i paint
> >> some GdkPixmaps, and some of this GdkPixmaps have some
> >> transparent areas, the problem is when i paint them, the transparent 
> >> areas are painted in white! How do i do so that the transparent areas aren't
> > 
> >> painted?
> >
> >The problem is, there is no such thing as a GdkPixmap with a transparent
> >area. Transparent pixels are handled by setting the clip mask in the
> >graphics context. If you created the pixmap from an xpm, the same function
> >which created the pixmap also created the mask you need to use.
>
> this is not *quite* true. you can use gdk_window_shape_combine_mask()
> to create genuinely transparent areas without setting the clip mask
> for every drawing operation. however, using
> gdk_window_shape_combine_mask() is not trivial to do in every case.

That sets the shape of the window you're drawing to. It has nothing to
do with defining transparent pixels in the pixmap itself.

Ron Steinke



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