Re: Colored XBM



herbertg insightbb com wrote:

Hey there folks,

I'm trying to build an application which shows the same, simple image, in
different fore- and background colors.

The way I used to this in my old TK based applications was to use a "xbm" file
and "attach" this image to a TK-Label. Then I changed the fore- and background
color of the label to the required colors which in fact changed the color of the
image ).

Is there any way to do something similar with GTK?
I think you have to create a bitmap from the XBM data and then use it as the stipple in a GC when drawing on a pixmap. The pixmap can then be put in a GtkImage for display. See:

http://developer.gnome.org/doc/API/2.0/gdk/gdk-Drawing-Primitives.html#gdk-draw-drawable

John



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