class Fl_Pixmap
#include <FL/Fl_Pixmap.H>

This object encapsulates the data from an XPM image, and allows you to make an Fl_Object use a pixmap as a label, or to just draw the pixmap directly. Under X it will create an offscreen pixmap the first time it is drawn, and copy this each subsequent time it is drawn.

The current implementation converts the pixmap to 8 bit color data and uses fl_draw_image() to draw it. Thus you will get dithered colors on an 8 bit screen.

Fl_Pixmap(char * const * data);

Construct from XPM data. The data pointer is simply copied to the object, so it must point at persistent storage. To use an XPM file, #include "foo.xpm", and then do "new Fl_Pixmap(foo)"

~Fl_Pixmap()

The destructor will destroy any X pixmap created. It does not do anything to the data.

void fl_draw(Fl_Pixmap *b,int x,int y,int w,int h);

Draw the pixmap centered in (and possibly clipped to) the given bounding box. If there is any error decoding the pixmap data then nothing is drawn.

void Fl_Pixmap::label(Fl_Object *);

Change the label() and the labeltype() of the object to draw the pixmap. You can use the same pixmap for many objects.

(back to contents)