-
Notifications
You must be signed in to change notification settings - Fork 2
/
svg_panel.h
37 lines (29 loc) · 927 Bytes
/
svg_panel.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
#ifndef _SVG_PANEL_H
#define _SVG_PANEL_H
#define wxCOLOR_FROM_NSVG(x) wxColour( x&0xff, (x>>8)&0xff, (x>>16)&0xff, (x>>24)&0xff )
// for showing the text label on the SVGPanel
struct TextLabel
{
wxString label; /// the text content of the label
float x; /// x coordinates of label
float y; /// y coordinates of label
wxString family; /// font name string, e.g. Arial, Courier New
float fontSize; /// font size
};
struct NSVGimage;
class SVGPanel : public wxPanel
{
public:
SVGPanel(wxWindow* parent, int id, const wxString& svg_filename = wxEmptyString);
~SVGPanel();
void OnPaint(wxPaintEvent& event);
void LoadSVG(const wxString& filename);
private:
NSVGimage* m_svg_image;
wxBitmap m_bitmap;
// for showing the text label on the SVGPanel
std::vector<TextLabel> m_TextLabels;
float m_Scale; /// user scaled from m_svg_image to m_bitmap
DECLARE_EVENT_TABLE()
};
#endif