refData->m_bitmapMask = new wxMask((WXHBITMAP)
wxInvertMask(iconInfo.hbmMask, w, h));
+
+ // delete the old one now as we don't need it any more
+ ::DeleteObject(iconInfo.hbmMask);
+
#if WXWIN_COMPATIBILITY_2
refData->m_ok = TRUE;
#endif // WXWIN_COMPATIBILITY_2
if (depth == -1) depth = wxDisplayDepth();
SetDepth( depth );
+ // Copy the palette from the source image
+ SetPalette(image.GetPalette());
+
// create a DIB header
int headersize = sizeof(BITMAPINFOHEADER);
BITMAPINFO *lpDIBh = (BITMAPINFO *) malloc( headersize );
// scan the bitmap for the transparent colour and set the corresponding
// pixels in the mask to BLACK and the rest to WHITE
- COLORREF maskColour = wxColourToRGB(colour);
+ COLORREF maskColour = RGB(colour.Red(), colour.Green(), colour.Blue());
m_maskBitmap = (WXHBITMAP)::CreateBitmap(width, height, 1, 1, 0);
HDC srcDC = ::CreateCompatibleDC(NULL);