X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b8ab2f93ab0914f204c5137c2ec0844dcb7dec5..56f69d54faea99a58828c2077c42fccc1303e490:/src/msw/bitmap.cpp diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index dd6423fff7..e6419cac7e 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -827,6 +827,13 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc ) wxImage wxBitmap::ConvertToImage() const { + // the colour used as transparent one in wxImage and the one it is replaced + // with when it really occurs in the bitmap + static const int MASK_RED = 1; + static const int MASK_GREEN = 2; + static const int MASK_BLUE = 3; + static const int MASK_BLUE_REPLACEMENT = 2; + wxImage image; wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); @@ -918,27 +925,37 @@ wxImage wxBitmap::ConvertToImage() const ::SetBkColor( memdc, RGB( 255, 255, 255 ) ); ::GetDIBits( memdc, hbitmap, 0, height, lpBits, lpDIBh, DIB_RGB_COLORS ); ::DeleteDC( memdc ); - // background color set to RGB(16,16,16) in consistent with wxGTK - unsigned char r=16, g=16, b=16; ptdata = data; ptbits = lpBits; for( i=0; i