-
Notifications
You must be signed in to change notification settings - Fork 2
/
ImagePanel.h
45 lines (41 loc) · 934 Bytes
/
ImagePanel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __IMAGEPANEL_H
#define __IMAGEPANEL_H
#include <wx/wx.h>
#include <wx/image.h>
#include <wx/string.h>
#include <wx/dynarray.h>
#include <wx/stream.h>
#include <wx/wfstream.h>
class ImagePanel : public wxPanel
{
public:
ImagePanel(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
long style,
const wxString &name);
ImagePanel(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
long style,
const wxString &name,
wxImage &imageIn);
void SetImage(wxImage &imageIn);
virtual ~ImagePanel();
wxString GetValue();
void OnPaint(wxPaintEvent &event);
void OnResize(wxSizeEvent &event);
void Maximise();
void DrawImage();
void Scale(float scaleFactor);
void Proportion(int maxWidth,int maxHeight);
void Clear();
private:
wxImage image;
float currentScale;
bool painting;
DECLARE_EVENT_TABLE()
};
#endif