Derive wxBitmap from wxBitmapBase.
Move code from LoadFile/SaveFile/Create* to bitmap handlers. Implemented wxBitmap::GetSubBitmap. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -66,7 +66,15 @@ private:
|
||||
// wxBitmap
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxBitmap: public wxGDIObject
|
||||
class WXDLLEXPORT wxBitmapHandler : public wxBitmapHandlerBase
|
||||
{
|
||||
public:
|
||||
wxBitmapHandler() : wxBitmapHandlerBase() {}
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
};
|
||||
|
||||
class wxBitmap: public wxBitmapBase
|
||||
{
|
||||
public:
|
||||
wxBitmap();
|
||||
@@ -75,7 +83,7 @@ public:
|
||||
wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); }
|
||||
wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); }
|
||||
wxBitmap( const wxBitmap& bmp );
|
||||
wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM );
|
||||
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
||||
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
|
||||
~wxBitmap();
|
||||
wxBitmap& operator = ( const wxBitmap& bmp );
|
||||
@@ -83,8 +91,12 @@ public:
|
||||
bool operator != ( const wxBitmap& bmp ) const;
|
||||
bool Ok() const;
|
||||
|
||||
static void InitStandardHandlers();
|
||||
|
||||
bool Create(int width, int height, int depth = -1);
|
||||
|
||||
bool Create(void* data, wxBitmapType type,
|
||||
int width, int height, int depth = -1);
|
||||
|
||||
int GetHeight() const;
|
||||
int GetWidth() const;
|
||||
int GetDepth() const;
|
||||
@@ -99,12 +111,13 @@ public:
|
||||
|
||||
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||
|
||||
bool SaveFile( const wxString &name, int type, wxPalette *palette = (wxPalette *) NULL );
|
||||
bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM );
|
||||
bool SaveFile( const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL ) const;
|
||||
bool LoadFile( const wxString &name, wxBitmapType type = wxBITMAP_TYPE_XPM );
|
||||
|
||||
wxPalette *GetPalette() const;
|
||||
wxPalette *GetColourMap() const
|
||||
{ return GetPalette(); };
|
||||
virtual void SetPalette(const wxPalette& palette);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
Reference in New Issue
Block a user