+ // default ctor creates an invalid bitmap, you must Create() it later
+ wxBitmap() { Init(); }
+
+ // Copy constructors
+ inline wxBitmap(const wxBitmap& rBitmap)
+ : wxGDIImage(rBitmap)
+ {
+ Init();
+ SetHandle(rBitmap.GetHandle());
+ }
+
+ // Initialize with raw data
+ wxBitmap( const char bits[]
+ ,int nWidth
+ ,int nHeight
+ ,int nDepth = 1
+ );
+
+ // Initialize with XPM data
+ wxBitmap(const char** ppData) { CreateFromXpm(ppData); }
+ wxBitmap(char** ppData) { CreateFromXpm((const char**)ppData); }
+
+ // Load a resource
+ wxBitmap( int nId
+ ,long lType = wxBITMAP_TYPE_BMP_RESOURCE
+ );
+
+ // For compatiability with other ports, under OS/2 does same as default ctor
+ inline wxBitmap( const wxString& WXUNUSED(rFilename)
+ ,long WXUNUSED(lType)
+ )
+ { Init(); }
+ // New constructor for generalised creation from data
+ wxBitmap( void* pData
+ ,long lType
+ ,int nWidth
+ ,int nHeight
+ ,int nDepth = 1
+ );
+
+ // If depth is omitted, will create a bitmap compatible with the display
+ wxBitmap( int nWidth, int nHeight, int nDepth = -1 );
+
+ wxBitmap( const wxImage& image, int depth = -1 )
+ { (void)CreateFromImage(image, depth); }
+
+ // we must have this, otherwise icons are silently copied into bitmaps using
+ // the copy ctor but the resulting bitmap is invalid!
+ inline wxBitmap(const wxIcon& rIcon)
+ { Init(); CopyFromIcon(rIcon); }
+
+ wxBitmap& operator=(const wxIcon& rIcon)
+ {
+ (void)CopyFromIcon(rIcon);
+
+ return(*this);
+ }
+
+ wxBitmap& operator=(const wxCursor& rCursor)
+ {
+ (void)CopyFromCursor(rCursor);
+ return (*this);
+ }
+
+ virtual ~wxBitmap();
+
+ wxImage ConvertToImage() const;
+
+ // get the given part of bitmap
+ wxBitmap GetSubBitmap(const wxRect& rRect) const;
+
+ // copies the contents and mask of the given (colour) icon to the bitmap
+ bool CopyFromIcon(const wxIcon& rIcon);
+
+ // copies the contents and mask of the given cursor to the bitmap
+ bool CopyFromCursor(const wxCursor& rCursor);
+
+ virtual bool Create( int nWidth
+ ,int nHeight
+ ,int nDepth = -1
+ );
+ virtual bool Create( void* pData
+ ,long lType
+ ,int nWidth
+ ,int nHeight
+ ,int nDepth = 1
+ );
+ virtual bool LoadFile( int nId
+ ,long lType = wxBITMAP_TYPE_BMP_RESOURCE
+ );
+ virtual bool LoadFile( const wxString& rName
+ ,long lType = wxBITMAP_TYPE_XPM
+ );
+ virtual bool SaveFile( const wxString& rName
+ ,int lType
+ ,const wxPalette* pCmap = NULL
+ );
+
+ inline wxBitmapRefData* GetBitmapData() const
+ { return (wxBitmapRefData *)m_refData; }
+
+ inline int GetQuality() const
+ { return (GetBitmapData() ? GetBitmapData()->m_nQuality : 0); }
+
+ void SetQuality(int nQ);
+
+ wxPalette* GetPalette() const
+ { return (GetBitmapData() ? (& GetBitmapData()->m_vBitmapPalette) : (wxPalette*) NULL); }
+
+ void SetPalette(const wxPalette& rPalette);
+
+ inline wxMask* GetMask() const
+ { return (GetBitmapData() ? GetBitmapData()->m_pBitmapMask : (wxMask*) NULL); }
+
+ void SetMask(wxMask* pMask) ;
+
+ inline bool operator==(const wxBitmap& rBitmap) const
+ { return m_refData == rBitmap.m_refData; }
+
+ inline bool operator!=(const wxBitmap& rBitmap) const
+ { return m_refData != rBitmap.m_refData; }
+
+ // Implementation