[9144] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

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

daemon@ATHENA.MIT.EDU (Stephan Krings)
Fri Oct 9 22:46:53 1998

Date: Sat, 10 Oct 1998 04:47:25 +0200 (CEST)
From: Stephan Krings <slothkri@zedat.fu-berlin.de>
To: gtk-list@redhat.com
In-Reply-To: <199810100130.VAA06060@bananoid.labs.redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

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

-- 
Stephan Krings                                       Freie Universitaet Berlin
AG Kommunikationsserver      Zentraleinrichtung fuer Datenverarbeitung (ZEDAT)
slothkri@zedat.fu-berlin.de                                      Fabeckstr. 32
Tel: +49 30 838 3239                   				  14195 Berlin

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post