X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5dbe15d0bacde245539f54c4d97af6b4696f01f..472eec8a0391538e4dcf7f7c6c4f4d44c8383616:/include/wx/msw/bitmap.h diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index ffde65f429..8c239785af 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -30,6 +30,15 @@ class WXDLLIMPEXP_FWD_CORE wxMask; class WXDLLIMPEXP_FWD_CORE wxPalette; class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; +// What kind of transparency should a bitmap copied from an icon or cursor +// have? +enum wxBitmapTransparency +{ + wxBitmapTransparency_Auto, // default: copy alpha if the source has it + wxBitmapTransparency_None, // never create alpha + wxBitmapTransparency_Always // always use alpha +}; + // ---------------------------------------------------------------------------- // wxBitmap: a mono or colour bitmap // ---------------------------------------------------------------------------- @@ -80,7 +89,11 @@ public: // we must have this, otherwise icons are silently copied into bitmaps using // the copy ctor but the resulting bitmap is invalid! - wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); } + wxBitmap(const wxIcon& icon, + wxBitmapTransparency transp = wxBitmapTransparency_Auto) + { + CopyFromIcon(icon, transp); + } wxBitmap& operator=(const wxIcon& icon) { @@ -105,11 +118,17 @@ public: // get the given part of bitmap wxBitmap GetSubBitmap( const wxRect& rect ) const; + // NB: This should not be called from user code. It is for wx internal + // use only. + wxBitmap GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const; + // copies the contents and mask of the given (colour) icon to the bitmap - bool CopyFromIcon(const wxIcon& icon); + bool CopyFromIcon(const wxIcon& icon, + wxBitmapTransparency transp = wxBitmapTransparency_Auto); // copies the contents and mask of the given cursor to the bitmap - bool CopyFromCursor(const wxCursor& cursor); + bool CopyFromCursor(const wxCursor& cursor, + wxBitmapTransparency transp = wxBitmapTransparency_Auto); #if wxUSE_WXDIB // copies from a device independent bitmap @@ -175,7 +194,9 @@ protected: private: // common part of CopyFromIcon/CopyFromCursor for Win32 - bool CopyFromIconOrCursor(const wxGDIImage& icon); + bool + CopyFromIconOrCursor(const wxGDIImage& icon, + wxBitmapTransparency transp = wxBitmapTransparency_Auto); DECLARE_DYNAMIC_CLASS(wxBitmap)