#if wxUSE_XPM_IN_MSW
#define FOR_MSW 1
-#include "../../contrib/wxxpm/libxpm.34b/lib/xpm34.h"
+#include "../src/xpm/xpm34.h"
#endif
#include "wx/msw/dib.h"
if (m_bitmapMask)
delete m_bitmapMask;
m_bitmapMask = NULL;
+
}
wxList wxBitmap::sm_handlers;
#if wxUSE_XPM_IN_MSW
// Create from data
-wxBitmap::wxBitmap(const char **data, wxItem *WXUNUSED(anItem))
+wxBitmap::wxBitmap(char **data, wxItem *WXUNUSED(anItem))
{
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
}
LPBITMAPINFO lpDib;
void *lpBits = NULL;
+/*
wxASSERT( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) );
tmpBitmap.SetPalette(this->GetPalette());
memDC.SetPalette(this->GetPalette());
hPal = (HPALETTE) this->GetPalette()->GetHPALETTE();
+*/
+ if( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) )
+ {
+ tmpBitmap.SetPalette(* this->GetPalette());
+ memDC.SelectObject(tmpBitmap);
+ memDC.SetPalette(* this->GetPalette());
+ hPal = (HPALETTE) this->GetPalette()->GetHPALETTE();
+ }
+ else
+ {
+ hPal = (HPALETTE) ::GetStockObject(DEFAULT_PALETTE);
+ wxPalette palette;
+ palette.SetHPALETTE( (WXHPALETTE)hPal );
+ tmpBitmap.SetPalette( palette );
+ memDC.SelectObject(tmpBitmap);
+ memDC.SetPalette( palette );
+ }
// set the height negative because in a DIB the order of the lines is reversed
createDIB(this->GetWidth(), -this->GetHeight(), this->GetDepth(), hPal, &lpDib);