Re: [gtk-list] Re: Transparent pixmaps...

Hello again,

> You have to use the clip mask.  Let's say you have the pixmap in
> my_pixmap, and the mask in my_mask.  You could use something like this:
> void
> paint_pixmap_and_mask (GdkDrawable *dest, GdkGC *gc, int x, int y, GdkPixmap *pixmap, GdkBitmap *mask)
> {
> 	gint w, h;
> 	gdk_gc_set_clip_mask (gc, mask);
> 	gdk_gc_set_clip_origin (gc, x, y);
> 	gdk_window_get_size (pixmap, &w, &h);
> 	gdk_draw_pixmap (drawable, gc, pixmap, 0, 0, x, y, w, h);
> 	gdk_gc_set_clip_mask (gc, NULL);
> }

Ok, using a clip-mask sounds reasonable for me. But I have to follow
up with another question: How do I create the mask?

Once again I'd like to do this in memory. Looking through gdk.h all I
find is gdk_bitmap_create_from_data. But I can't figure out how to use 
this function. Or is there another way?

Once again, thank you...


Stephan Krings                                       Freie Universitaet Berlin
AG Kommunikationsserver      Zentraleinrichtung fuer Datenverarbeitung (ZEDAT)                                      Fabeckstr. 32
Tel: +49 30 838 3239                   				  14195 Berlin

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