Next: , Previous: , Up: Bitmap Object   [Contents][Index]


15.5.4 Other Bitmap Routines

To set the actual bitmap being displayed use

void fl_set_bitmap_data(FL_OBJECT *obj, int w, int h,
                         unsigned char *bits);
void fl_set_bitmap_file(FL_OBJECT *obj, const char *file);

bits contains the bitmap data as a character string. file is the name of the file that contains the bitmap data. A number of bitmaps can be found in /usr/include/X11/bitmaps or similar places. The X program bitmap can be used to create bitmaps.

Two additional routines are provided to make a Bitmap from a bitmap file or data

Pixmap fl_read_bitmapfile(Window win, const char *filename,
                          unsigned *width, unsigned *height,
                          int *hotx, int *hoty)
Pixmap fl_create_from_bitmapdata(Window win, const char *data,
                                 int width, int height);

where win is any window ID in your application and the other parameters have the obvious meanings. If there is no window created yet, the return value of fl_default_window() may be used.

Note: bitmaps created by the above routines have a depth of 1 and should be displayed using XCopyPlane().