PictureView.h 609 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright 2009, Pier Luigi Fiorini. All rights reserved.
  3. * Distributed under the terms of the MIT License.
  4. */
  5. #ifndef _PICTURE_VIEW_H
  6. #define _PICTURE_VIEW_H
  7. #include <View.h>
  8. class BBitmap;
  9. class PictureView : public BView {
  10. public:
  11. PictureView(const char* name, const char* filename,
  12. uint32 flags = B_WILL_DRAW);
  13. ~PictureView();
  14. status_t InitCheck();
  15. virtual BSize MinSize();
  16. virtual BSize MaxSize();
  17. virtual BSize PreferredSize();
  18. virtual void Draw(BRect frame);
  19. private:
  20. BBitmap* fBitmap;
  21. float fWidth;
  22. float fHeight;
  23. };
  24. #endif // _PICTURE_VIEW_H