Btk
imageview.hpp
1 #if !defined(_BTK_IMAGEVIEW_HPP_)
2 #define _BTK_IMAGEVIEW_HPP_
3 #include "widget.hpp"
4 #include "pixels.hpp"
5 #include "rect.hpp"
6 #include "defs.hpp"
7 //the image view widget
8 namespace Btk{
9  class BTKAPI ImageView:public Widget{
10  public:
12  ImageView(Container&,int x,int y,int w,int h);
13  ~ImageView();
14  //set image
15  void set_image(const PixBuf &buf);
16  //ref image
17  void ref_image(PixBuf &buf);
18  //called from parent widget
19  void draw(Renderer &);
20  //Clip this image
21  void set_clip(const Rect &r);
22 
23  PixBuf &image(){
24  return pixelbuf;
25  }
26  const PixBuf &image() const{
27  return pixelbuf;
28  }
29  private:
30  PixBuf pixelbuf;
31  Texture texture;
32  Rect image_rect;
33  };
34 };
35 
36 #endif // _BTK_IMAGEVIEW_HPP_
Definition: pixels.hpp:191
a SDL_Rect with methods
Definition: rect.hpp:10
Definition: widget.hpp:219
This header include many useful containers.
Definition: async.hpp:7
Definition: imageview.hpp:9
Definition: pixels.hpp:32
A Container of Widget.
Definition: widget.hpp:108