el h / SimpleGUI

Fork of SimpleGUI by Duncan McIntyre

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers BitmapWidget.h Source File

BitmapWidget.h

00001 #ifndef SIMPLEGUI_BITMAP_WIDGET_H
00002 #define SIMPLEGUI_BITMAP_WIDGET_H
00003 
00004 #include "Widget.h"
00005 
00006 class BitmapWidget : public Widget {
00007     
00008     public:
00009     
00010         BitmapWidget(GraphicsContext *context);
00011         BitmapWidget(GraphicsContext *context, bool monochrome);
00012                 
00013         // Ccncrete methods for this class
00014         void setBitmap(unsigned char const * bitmap, int width, int height);
00015         
00016         // Set to draw the bitmap in monochrome
00017         void setMonochrome(bool enabled);
00018         bool isMonochrome();
00019         
00020         // Override to accommodate auto-resizing (yes, yes. sorry)
00021         virtual void setBorder(int width, uint16_t color);
00022     
00023     protected:
00024 
00025         virtual void _draw();      
00026             
00027         unsigned char* _bitmap;
00028         bool _monochrome;
00029         int _bitmapWidth, _bitmapHeight;
00030 };
00031 
00032 #endif