[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Question on gdk_gc_set_clip_mask()
- From: andy ritger <ritger wolfram com>
- To: gtk-app-devel-list redhat com
- Subject: Re: Question on gdk_gc_set_clip_mask()
- Date: Wed, 16 Feb 2000 15:29:53 -0600 (CST)
in you pixdrawer macro, you need to add:
gdk_gc_set_clip_origin (drawable, x, y);
To position the mask relative to the drawable.
Also, this may be a dumb question, but does "-1, -1" work for the
dimensions to copy? I've always explicitly given the desired dimensions;
does "-1, -1" imply the dimensions of the source pixmap?
Hope that helps.
- andy
On Wed, 16 Feb 2000, Matthew Hiller wrote:
[ I've been working on a graphical musical score editor called
[ Denemo (http://denemo.sourceforge.net/) for the past few months. Anyway,
[ I've been using a gtk drawing area to display the score, which I draw on
[ with a combination of gdk_draw_pixmap()s (I've got a number of
[ black-and-white pixmaps for clefs, noteheads, stems, rests, etc.) and the
[ other gdk functions. To avoid there being a rectangular halo of white
[ around each pixmap, I've been careful to draw all the pixmaps first, then
[ everything else.
[
[ Anyway, I'd like to move away from that, and thought I'd hit upon
[ the solution when I found that gdk graphics contexts have clipmasks.
[ So, I tried creating and drawing my pixmaps using the following two
[ macros: however, when I do they don't draw at all:
[
[ #define pixhelper(widget, pixmap, mask, data) \
[ pixmap = \
[ gdk_pixmap_create_from_xpm_d(widget->window, &mask, \
[ &(widget->style->white), data)
[
[ /* Handy macro that allows me to draw the pixmaps transparently */
[
[ #define pixdrawer(drawable, widget, pixmap, x, y, mask) \
[ gdk_gc_set_clip_mask(widget->style->black_gc, mask);\
[ gdk_draw_pixmap(drawable, widget->style->black_gc, pixmap, \
[ 0, 0, x, y, -1, -1);\
[ gdk_gc_set_clip_mask(widget->style->black_gc, NULL)
[
[ (And yes, I also tried using &(widget->style->black) in the first macro,
[ in case I was getting messed up by an inverse-video thing, but the effect
[ was the same.)
[
[ So, I guess I'm misunderstanding what gdk gc clip masks do - can anyone
[ set me straight on this?
[
[ Thanks,
[ Matt Hiller
[
[
[ --
[ To unsubscribe: mail gtk-app-devel-list-request@redhat.com with
[ "unsubscribe" as the Subject.
[
[ Mailing list concerns should be mailed to <listmaster@redhat.com>
[
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]