class fltk::Bitmap


This subclass of fltk::Image encapsulates the width, height, and bits of an X bitmap (XBM), and allows you to make an fltk::Widget use a bitmap as a label, or to just draw the bitmap directly.

fltk::Bitmap(const char *bits, int W, int H)
fltk::Bitmap(const unsigned char *bits, int W, int H)

Construct using an X bitmap. The bits pointer is simply copied to the object, so it must point at persistent storage. The two constructors are provided because various X implementations disagree about the type of bitmap data. To use an XBM file use:
#include "foo.xbm"
...
fltk::Bitmap bitmap = new fltk::Bitmap(foo_bits, foo_width, foo_height);

~Bitmap()

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

void draw(int x, int y, int w, int h, fltk::Flags = 0)

The image is drawn with the top-left corner at x,y. The w and h are ignored. 1 bits are drawn with the current color, 0 bits are unchanged. The flags are ignored (fltk::INACTIVE can be done by selecting a gray version of the color).

void draw(int x, int y, fltk::Flags = 0)

Draws the image with the upper-left corner at x,y. This is the same as doing draw(x, y, this->w, this->h, flags).