1 #ifndef WXFRAMEIMAGE_H_
2 #define WXFRAMEIMAGE_H_
4 #include <wx/control.h>
7 class MyImageCtrl
: public wxControl
10 MyImageCtrl(wxWindow
*parent
);
11 virtual ~MyImageCtrl();
13 void OnEraseBackground(wxEraseEvent
& WXUNUSED(event
));
14 virtual void OnPaint(wxPaintEvent
& WXUNUSED(event
));
15 virtual void EvtSize(wxSizeEvent
& evt
);
16 void EvtContextMenu( wxContextMenuEvent
& event
);
18 virtual void mySetSize(int& width
, int& height
);
19 virtual void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
20 virtual void SetSize(int width
, int height
);
21 virtual void SetSize(const wxRect
& rect
);
22 virtual void SetSize(const wxSize
& size
);
24 void ScaleImage(double factor
);
25 void Rotate90(int nb_crans
);
26 void Set_Mirroring( bool b_mirroring
= true );
28 void SetImage( wxImage
* );
30 void Set_BoundDimensions( int max_x
, int max_y
= wxDefaultCoord
, int min_x
= wxDefaultCoord
, int min_y
= wxDefaultCoord
);
38 virtual wxSize
DoGetBestSize() const;
39 float Get_Scale_Factor( int _x
, int _y
)const;
40 void ReboundSize( int& _x
, int& _y
)const;
41 void Get_TransformedImgSize(int& _w
, int& _h
)const;
43 void EvtMouseSomething(wxMouseEvent
& event
);
45 // The bitmap image is not owned by MyImageCtrl
47 mutable wxBitmap
*theBitmap
;
49 int max_x
, max_y
, min_x
, min_y
;
58 #endif /*WXFRAMEIMAGE_H_*/