From 650368d057896c5bf6b1f2294766e92b7dbb7f20 Mon Sep 17 00:00:00 2001 From: "Unknown (AN)" Date: Thu, 10 Dec 1998 22:41:43 +0000 Subject: [PATCH] correct a bug in the MSW code using wxMask git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/image.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/common/image.cpp b/src/common/image.cpp index 77a40d5..142eed1 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -1108,27 +1108,27 @@ wxBitmap wxImage::ConvertToBitmap() const { if( (*(ptdata++)!=r) | (*(ptdata++)!=g) | (*(ptdata++)!=b) ) { - *(ptbits++) = zero; - *(ptbits++) = zero; - *(ptbits++) = zero; - } - else - { *(ptbits++) = one; *(ptbits++) = one; *(ptbits++) = one; } + else + { + *(ptbits++) = zero; + *(ptbits++) = zero; + *(ptbits++) = zero; + } } hbitmap = ::CreateBitmap( (WORD)width, (WORD)height, 1, 1, NULL ); ::SetDIBits( hdc, hbitmap, 0, (WORD)height, lpBits, lpDIBh, DIB_RGB_COLORS); - wxMask bmpmask; - bmpmask.SetMaskBitmap( (WXHBITMAP) hbitmap ); - bitmap.SetMask( &bmpmask ); + wxMask *mask = new wxMask(); + mask->SetMaskBitmap( (WXHBITMAP) hbitmap ); + bitmap.SetMask( mask ); /* The following can also be used but is slow to run wxColour colour( GetMaskRed(), GetMaskGreen(), GetMaskBlue()); - wxMask bmpmask( bitmap, colour ); - bitmap.SetMask( &bmpmask ); + wxMask *mask = new wxMask( bitmap, colour ); + bitmap.SetMask( mask ); */ } -- 2.7.4