New Classes

FXBitmapView

The new FXBitmapView widget is similar to the already available FXImageView widget: it is a subclass of FXScrollArea which supports the display of large bitmaps inside a scrollable window. To construct an FXBitmapView widget with an already-existing bitmap, simply pass a pointer to the FXBitmap in as the second argument to FXBitmapView's constructor, i.e.

FXBitmap *bitmap = new FXBitmap(getApp(), pix);
FXBitmapView *view = new FXBitmapView(parent, bitmap, NULL, 0, LAYOUT_FILL);

You can also use the getBitmap() and setBitmap() member functions to get or set the current bitmap after construction.

Since bitmaps don't have any inherent color information, you should use the getOnColor(), getOffColor(), setOnColor() and setOffColor() member functions to specify which colors to use for the "on" and "off" bits in the bitmap. By default, the FXBitmapView will use pure black for the "on" bits and the window's background color for the "off" bits.

If the bitmap's dimensions are actually smaller than those of the scroll area's viewport, the alignment of the bitmap inside the viewport can be specified by calling the setAlignment() member function. The setAlignment() member function accepts some combination of the flags BITMAPVIEW_LEFT, BITMAPVIEW_RIGHT, BITMAPVIEW_BOTTOM and BITMAPVIEW_TOP. So, for example, if you wanted the bitmap to be aligned against the upper right-hand corner of the viewport, you'd write:

bitmapView->setAlignment(BITMAPVIEW_TOP|BITMAPVIEW_RIGHT);

By default, the bitmap is centered inside the viewport.

Finally, remember that bitmaps are shared resources and so the FXBitmapView widget will not destroy the currently assigned bitmap when the FXBitmapView widget is destroyed. In order to avoid memory leaks in your program, you must delete the FXBitmap object separately.