+#if wxUSE_XPM_IN_MSW
+
+static void XpmToBitmap(wxBitmap *bitmap,
+ const XImage *ximage,
+ const XpmAttributes& xpmAttr)
+{
+ wxBitmapRefData *refData = bitmap->GetBitmapData();
+ refData->m_hBitmap = (WXHBITMAP)ximage->bitmap;
+
+ BITMAP bm;
+ if ( !::GetObject(GetHbitmapOf(*bitmap), sizeof(bm), (LPSTR) & bm) )
+ {
+ wxLogLastError("GetObject(bitmap)");
+ }
+
+ refData->m_width = bm.bmWidth;
+ refData->m_height = bm.bmHeight;
+ refData->m_depth = bm.bmPlanes * bm.bmBitsPixel;
+ refData->m_numColors = xpmAttr.npixels;
+}
+
+#endif // wxUSE_XPM_IN_MSW
+