+ wxPalette *GetColourMap() const { return GetPalette(); }
+ void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); };
+#endif // WXWIN_COMPATIBILITY
+#endif // wxUSE_PALETTE
+
+ // Implementation
+public:
+ void SetHBITMAP(WXHBITMAP bmp) { SetHandle((WXHANDLE)bmp); }
+ WXHBITMAP GetHBITMAP() const { return (WXHBITMAP)GetHandle(); }
+
+#if wxUSE_DIB_FOR_BITMAP
+ void SetHFileMap(WXHANDLE hFileMap) { GetBitmapData()->m_hFileMap = hFileMap; }
+ WXHANDLE GetHFileMap() const { return GetBitmapData()->m_hFileMap; }
+#endif // wxUSE_DIB_FOR_BITMAP
+
+ void SetSelectedInto(wxDC *dc) { if (GetBitmapData()) GetBitmapData()->m_selectedInto = dc; }
+ wxDC *GetSelectedInto() const { return (GetBitmapData() ? GetBitmapData()->m_selectedInto : (wxDC*) NULL); }
+
+ // Creates a bitmap that matches the device context's depth, from an
+ // arbitray bitmap. At present, the original bitmap must have an associated
+ // palette. (TODO: use a default palette if no palette exists.) This
+ // function is necessary for you to Blit an arbitrary bitmap (which may
+ // have the wrong depth). wxDC::SelectObject will compare the depth of the
+ // bitmap with the DC's depth, and create a new bitmap if the depths
+ // differ. Eventually we should perhaps make this a public API function so
+ // that an app can efficiently produce bitmaps of the correct depth. The
+ // Windows solution is to use SetDibBits to blit an arbotrary DIB directly
+ // to a DC, but this is too Windows-specific, hence this solution of
+ // quietly converting the wxBitmap. Contributed by Frederic Villeneuve
+ // <frederic.villeneuve@natinst.com>
+ wxBitmap GetBitmapForDC(wxDC& dc) const;
+
+protected:
+ // common part of all ctors
+ void Init();
+
+ virtual wxGDIImageRefData *CreateData() const
+ { return new wxBitmapRefData; }
+
+ // creates the bitmap from XPM data, supposed to be called from ctor
+ bool CreateFromXpm(const char **bits);
+
+#if wxUSE_IMAGE
+ // creates the bitmap from wxImage, supposed to be called from ctor
+ bool CreateFromImage(const wxImage& image, int depth);
+#endif // wxUSE_IMAGE
+
+#if wxUSE_DIB_FOR_BITMAP
+ void *CreateDIB(int width, int height, int depth);
+ void CopyDIBLine(void* src, void* dest, int count) const;