X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c1a88d8b8518eda184be388723f46cfd54c3ac6..0bd55cfa2c5c18d4e9241cf90195e30d0be5d905:/src/msw/bitmap.cpp diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 3cf541d3c7..f0e07174d5 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -582,15 +582,15 @@ wxMask::~wxMask() // Create a mask from a mono bitmap (copies the bitmap). bool wxMask::Create(const wxBitmap& bitmap) { + wxCHECK_MSG( bitmap.Ok() && bitmap.GetDepth() == 1, FALSE, + _T("can't create mask from invalid or not monochrome bitmap") ); + if ( m_maskBitmap ) { ::DeleteObject((HBITMAP) m_maskBitmap); m_maskBitmap = 0; } - if (!bitmap.Ok() || bitmap.GetDepth() != 1) - { - return FALSE; - } + m_maskBitmap = (WXHBITMAP) CreateBitmap( bitmap.GetWidth(), bitmap.GetHeight(),