]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/bitmap.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __GTKBITMAPH__
13 #define __GTKBITMAPH__
20 #include "wx/object.h"
21 #include "wx/string.h"
22 #include "wx/palette.h"
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
43 class wxMask
: public wxObject
45 DECLARE_DYNAMIC_CLASS(wxMask
)
50 wxMask( const wxBitmap
& bitmap
, const wxColour
& colour
);
51 wxMask( const wxBitmap
& bitmap
, int paletteIndex
);
52 wxMask( const wxBitmap
& bitmap
);
61 friend wxBitmapButton
;
62 friend wxStaticBitmap
;
65 GdkBitmap
*GetBitmap() const;
73 //-----------------------------------------------------------------------------
75 //-----------------------------------------------------------------------------
77 // CMB 20/5/98: added xbm constructor and GetBitmap() method
78 class wxBitmap
: public wxObject
80 DECLARE_DYNAMIC_CLASS(wxBitmap
)
85 wxBitmap( int width
, int height
, int depth
= -1 );
86 wxBitmap( const char bits
[], int width
, int height
, int depth
= 1 );
87 wxBitmap( char **bits
);
88 wxBitmap( const wxBitmap
& bmp
);
89 wxBitmap( const wxBitmap
* bmp
);
90 wxBitmap( const wxString
&filename
, int type
= wxBITMAP_TYPE_XPM
);
92 wxBitmap
& operator = ( const wxBitmap
& bmp
);
93 bool operator == ( const wxBitmap
& bmp
);
94 bool operator != ( const wxBitmap
& bmp
);
97 int GetHeight() const;
100 void SetHeight( int height
);
101 void SetWidth( int width
);
102 void SetDepth( int depth
);
104 wxMask
*GetMask() const;
105 void SetMask( wxMask
*mask
);
107 void Resize( int height
, int width
);
109 bool SaveFile( const wxString
&name
, int type
, wxPalette
*palette
= NULL
);
110 bool LoadFile( const wxString
&name
, int type
= wxBITMAP_TYPE_XPM
);
112 wxPalette
*GetPalette() const;
113 wxPalette
*GetColourMap() const
114 { return GetPalette(); };
122 friend wxBitmapButton
;
123 friend wxStaticBitmap
;
126 GdkPixmap
*GetPixmap() const;
127 GdkBitmap
*GetBitmap() const;
130 void RecreateImage();
136 #endif // __GTKBITMAPH__