class Fl_Bitmap
#include <FL/Fl_Bitmap.H>

This object encapsulates the width, height, and bits of an Xbitmap (XBM), and allows you to make an Fl_Object use a bitmap as a label, or to just draw the bitmap directly. Under X it will create an offscreen pixmap the first time it is drawn, and copy this each subsequent time it is drawn.

Fl_Bitmap(const char *bits, int W, int H);
Fl_Bitmap(const uchar *bits, int W, int H);

Construct from an Xbitmap. The bits pointer is simply copied to the object, so it must point at persistent storage. I provide two constructors because various X implementations disagree about the type of bitmap data. To use an XBM file, #include "foo.xbm", and then do "new Fl_Bitmap(foo_bits,foo_width,foo_height)"

~Fl_Bitmap()

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

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

Draw the bitmap centered in the given bounding box. 1 bits are drawn with the current color, 0 bits are unchanged.

void Fl_Bitmap::label(Fl_Object *);

Change the label() and the labeltype() of the object to draw the bitmap. 1 bits will be drawn with the labelcolor(), zero bits will be unchanged. You can use the same bitmap for many objects.

(back to contents)