Re: Mask Problems



Brian Victor <bhv1 psu edu> writes: 
  GdkBitmap *mask=NULL;

  /* the window widget has already been shown at this point. */
  gc = gdk_gc_new(window->window);
  noteheadPM = gdk_pixmap_create_from_xpm_d (window->window, &mask,
                                             &(window->style->white),

This argument is the color to fill in the transparent pixels with, or
NULL to use white. It's not the color to make transparent.

In XPM files, if the color is None then it's transparent. testgtk.c
has a couple of examples. Part of one is appended.

Havoc

So in this example ' ' chars are transparent:

static char * gtk_mini_xpm[] = {
"15 20 17 1",
"       c None",
".      c #14121F",
"+      c #278828",
"@      c #9B3334",
"#      c #284C72",
"$      c #24692A",
"%      c #69282E",
"&      c #37C539",
"*      c #1D2F4D",
"=      c #6D7076",
"-      c #7D8482",
";      c #E24A49",
">      c #515357",
",      c #9B9C9B",
"'      c #2FA232",
")      c #3CE23D",
"!      c #3B6CCB",
"               ",
"      ***>     ",
"    >.*!!!*    ",
"   ***....#*=  ",
"  *!*.!!!**!!# ",
" .!!#*!#*!!!!# ",
" @%#!.##.*!!$& ",
" @;%*!*.#!#')) ",
" @;;@%!!*$&)'' ",
" @% % %$'&)$+' ",




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