pixmaps and xpm-transparency



hi,

i've some problems with transparency of XPMs using pixmaps.

static char * base_xpm = {...}; // 32x32
static char * small_xpm = {...}; // 22x22

GdkBitmap *mask1, *mask2;
GtkWidget *gPix;
GtkStyle *style;

style = gtk_widget_get_style(gRootWindow);
pixmap1 = gdk_pixmap_colormap_create_from_xpm_d(
      NULL, gtk_widget_get_colormap(gRootWindow),
      &mask1, NULL, base_xpm);

pixmap2 = gdk_pixmap_colormap_create_from_xpm_d(
      NULL, gtk_widget_get_colormap(gRootWindow),
      &mask2, NULL, small_xpm);

/* now i try to draw the small_xpm onto the base_xpm */
gdk_draw_pixmap(pixmap1,
      style->fg_gc[GTK_STATE_NORMAL], pixmap2,
      0, 0, 5, 5, 22, 22);

gPix = gtk_pixmap_new(pixmap1, mask1);
gtk_widget_show(gPix);

the resulting widget shows a small_xpm over a base_xpm.
BUT: the transparency-parts ("   c None") of the small_xpm
     are rendered as white-pixels onto the base_xpm.
     i expected the base to shine through.

what am i doing wrong?

thanks in advance,

th
-- 
Tobias Hintze - http://hbs-solutions.de
HBS solutions GbR - Network & Information Systems





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