// wxBitmap creation
// ----------------------------------------------------------------------------
-// this function should be called from all wxBitmap ctors
-void wxBitmap::Init()
-{
- // m_refData = NULL; done in the base class ctor
-}
-
wxGDIImageRefData *wxBitmap::CreateData() const
{
return new wxBitmapRefData;
wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
{
- Init();
-
#ifndef __WXMICROWIN__
wxBitmapRefData *refData = new wxBitmapRefData;
m_refData = refData;
// Create from XPM data
bool wxBitmap::CreateFromXpm(const char **data)
{
-#if wxUSE_IMAGE && wxUSE_XPM
- Init();
-
+#if wxUSE_IMAGE && wxUSE_XPM && wxUSE_WXDIB
wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") )
wxXPMDecoder decoder;
wxBitmap::wxBitmap(int w, int h, int d)
{
- Init();
-
(void)Create(w, h, d);
}
wxBitmap::wxBitmap(int w, int h, const wxDC& dc)
{
- Init();
-
(void)Create(w, h, dc);
}
wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth)
{
- Init();
-
(void)Create(data, type, width, height, depth);
}
wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type)
{
- Init();
-
LoadFile(filename, (int)type);
}
return handler->LoadFile(this, filename, type, -1, -1);
}
-#if wxUSE_IMAGE
+#if wxUSE_IMAGE && wxUSE_WXDIB
else // no bitmap handler found
{
wxImage image;
{
return handler->SaveFile(this, filename, type, palette);
}
-#if wxUSE_IMAGE
+#if wxUSE_IMAGE && wxUSE_WXDIB
else // no bitmap handler found
{
// FIXME what about palette? shouldn't we use it?