]>
Commit | Line | Data |
---|---|---|
32b8ec41 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: bitmap.h | |
3 | // Author: Vaclav Slavik | |
4 | // RCS-ID: $Id$ | |
52750c2e | 5 | // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) |
65571936 | 6 | // Licence: wxWindows licence |
32b8ec41 VZ |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
32b8ec41 VZ |
9 | #ifndef __WX_BITMAP_H__ |
10 | #define __WX_BITMAP_H__ | |
11 | ||
32b8ec41 VZ |
12 | //----------------------------------------------------------------------------- |
13 | // classes | |
14 | //----------------------------------------------------------------------------- | |
15 | ||
b5dbe15d VS |
16 | class WXDLLIMPEXP_FWD_CORE wxDC; |
17 | class WXDLLIMPEXP_FWD_CORE wxMemoryDC; | |
32b8ec41 VZ |
18 | |
19 | class MGLDevCtx; | |
20 | struct bitmap_t; | |
21 | ||
32b8ec41 VZ |
22 | //----------------------------------------------------------------------------- |
23 | // wxBitmap | |
24 | //----------------------------------------------------------------------------- | |
25 | ||
53a2db12 | 26 | class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase |
32b8ec41 VZ |
27 | { |
28 | public: | |
3cdd0895 | 29 | wxBitmap() {} |
32b8ec41 VZ |
30 | wxBitmap(int width, int height, int depth = -1); |
31 | wxBitmap(const char bits[], int width, int height, int depth = 1); | |
452418c4 | 32 | wxBitmap(const char* const* bits); |
32b8ec41 VZ |
33 | wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); |
34 | wxBitmap(const wxImage& image, int depth = -1); | |
d3c7fc99 | 35 | virtual ~wxBitmap() {} |
32b8ec41 VZ |
36 | |
37 | bool Create(int width, int height, int depth = -1); | |
38 | ||
39 | virtual int GetHeight() const; | |
40 | virtual int GetWidth() const; | |
41 | virtual int GetDepth() const; | |
42 | ||
43 | virtual wxImage ConvertToImage() const; | |
44 | ||
45 | virtual wxMask *GetMask() const; | |
46 | virtual void SetMask(wxMask *mask); | |
47 | ||
48 | virtual wxBitmap GetSubBitmap(const wxRect& rect) const; | |
49 | ||
50 | virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const; | |
51 | virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); | |
52 | ||
53 | virtual wxPalette *GetPalette() const; | |
54 | virtual void SetPalette(const wxPalette& palette); | |
55 | ||
56 | // copies the contents and mask of the given (colour) icon to the bitmap | |
57 | virtual bool CopyFromIcon(const wxIcon& icon); | |
58 | ||
59 | static void InitStandardHandlers(); | |
60 | ||
61 | // implementation: | |
62 | virtual void SetHeight(int height); | |
63 | virtual void SetWidth(int width); | |
64 | virtual void SetDepth(int depth); | |
65 | ||
87f83ac8 VZ |
66 | virtual wxColour QuantizeColour(const wxColour& colour) const; |
67 | ||
32b8ec41 VZ |
68 | // get underlying native representation: |
69 | bitmap_t *GetMGLbitmap_t() const; | |
70 | ||
71 | protected: | |
32b8ec41 VZ |
72 | // creates temporary DC for access to bitmap's data: |
73 | MGLDevCtx *CreateTmpDC() const; | |
74 | // sets fg & bg colours for 1bit bitmaps: | |
75 | void SetMonoPalette(const wxColour& fg, const wxColour& bg); | |
76 | ||
77 | private: | |
78 | DECLARE_DYNAMIC_CLASS(wxBitmap) | |
79 | ||
80 | friend class wxDC; | |
81 | friend class wxMemoryDC; | |
82 | }; | |
83 | ||
84 | #endif // __WX_BITMAP_H__ |