#pragma implementation "bitmap.h"
#endif
+#include "wx/defs.h"
+
+#include "wx/palette.h"
#include "wx/bitmap.h"
#include "wx/icon.h"
#include "wx/filefn.h"
wxBitmap::wxBitmap()
{
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
wxBitmap::wxBitmap( int width, int height, int depth )
{
Create( width, height, depth );
-
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
bool wxBitmap::Create( int width, int height, int depth )
M_BMPDATA->m_bpp = visual->depth; // ?
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
-
return TRUE;
}
m_refData = new wxBitmapRefData();
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
-
// ------
// convertion to mono bitmap:
// ------
wxBitmap::wxBitmap( const wxBitmap& bmp )
{
Ref( bmp );
-
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
wxBitmap::wxBitmap( const wxString &filename, int type )
{
LoadFile( filename, type );
-
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth))
M_BMPDATA->m_bpp = 1;
wxCHECK_RET( M_BMPDATA->m_bitmap, wxT("couldn't create bitmap") );
-
- if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
wxBitmap::~wxBitmap()
{
- if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this);
}
wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
{
- if (*this == bmp) return (*this);
- Ref( bmp );
+ if ( m_refData != bmp.m_refData )
+ Ref( bmp );
+
return *this;
}
M_BMPDATA->m_mask = mask;
}
+bool wxBitmap::CopyFromIcon(const wxIcon& icon)
+{
+ *this = icon;
+ return TRUE;
+}
+
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
{
wxCHECK_MSG( Ok() &&