[9209] in The GTK GIMP ToolKit mailing list archive

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

[gtk-list] Re: Clipping-Masks in Gdk

daemon@ATHENA.MIT.EDU (Stephan Krings)
Mon Oct 12 13:45:49 1998

From: Stephan Krings <slothkri@zedat.fu-berlin.de>
Date: Mon, 12 Oct 1998 17:01:22 +0200 (CEST)
To: blong@fiction.net
Cc: gtk-list@redhat.com
In-Reply-To: <19981011222401.A5475@shell9.ba.best.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

Hello Brandon,

> A bitmask has 1 bit per pixel, and you probably aren't running X in
> black & white, so the default (-1) isn't what you want.  Just take
> away the -.

Yes, I guessed that and tried it with 1 as an indicator for a simple
black and white mask, too. But that didn't change anything for me
cause the magic I was missing is...

> Additionally, the GC is dependent on the pixel depth, so you should
> create your GC for the mask using the mask instead of the drawing area
> window, so add this:
> 
>     gc = gdk_gc_new(mask);

...in this point here. I didn't know that it's necessary to create a
new GC dependent on that mask. And if I had known I'd have probably
been fooled by the prototype for gdk_gc_new, which takes a
GdkWindow-pointer as parameter. I've read somewhere that pixmaps and
bitmaps are just special kind of windows but I thought this similarity
would be restricted to the drawing-functions (gdk_draw_* etc).

Anyway this fixed all problems for me and the rest seems pretty clear
to me after that.

So, many thanks for your detailed code-examination and short tutorial!

Stephan

-- 
Stephan Krings                                       Freie Universitaet Berlin
AG Kommunikationsserver      Zentraleinrichtung fuer Datenverarbeitung (ZEDAT)
slothkri@zedat.fu-berlin.de                                      Fabeckstr. 32
Tel: +49 30 838 3527                   				  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