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



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



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