1 /* 2 * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef BITMAP_VIEW_H 6 #define BITMAP_VIEW_H 7 8 9 #include <View.h> 10 11 12 class BitmapView : public BView { 13 public: 14 BitmapView(const char* name); 15 16 virtual ~BitmapView(); 17 18 virtual void AttachedToWindow(); 19 virtual void Draw(BRect updateRect); 20 21 virtual BSize MinSize(); 22 virtual BSize PreferredSize(); 23 virtual BSize MaxSize(); 24 25 void SetBitmap(const BBitmap* bitmap); 26 void SetScaleBitmap(bool scaleBitmap); 27 28 protected: 29 virtual void DrawBackground(BRect& bounds, 30 BRect updateRect); 31 32 private: 33 const BBitmap* fBitmap; 34 bool fScaleBitmap; 35 }; 36 37 38 #endif // BITMAP_VIEW_H 39