+ *this = wxBitmap(image);
+#else
+ wxFAIL_MSG(wxT("creating bitmaps from XPMs not supported"));
+#endif // wxUSE_IMAGE && wxUSE_XPM
+}
+#endif // !(defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__))
+
+// ----------------------------------------------------------------------------
+// wxMaskBase
+// ----------------------------------------------------------------------------
+
+bool wxMaskBase::Create(const wxBitmap& bitmap, const wxColour& colour)
+{
+ FreeData();
+
+ return InitFromColour(bitmap, colour);
+}
+
+#if wxUSE_PALETTE
+
+bool wxMaskBase::Create(const wxBitmap& bitmap, int paletteIndex)
+{
+ wxPalette *pal = bitmap.GetPalette();
+
+ wxCHECK_MSG( pal, false,
+ wxT("Cannot create mask from palette index of a bitmap without palette") );
+
+ unsigned char r,g,b;
+ pal->GetRGB(paletteIndex, &r, &g, &b);
+
+ return Create(bitmap, wxColour(r, g, b));
+}
+
+#endif // wxUSE_PALETTE
+
+bool wxMaskBase::Create(const wxBitmap& bitmap)
+{
+ FreeData();
+
+ return InitFromMonoBitmap(bitmap);
+}