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
This commit is contained in:
Unknown (AN)
1998-12-10 22:41:43 +00:00
parent c9f8e0e22e
commit 650368d057

View File

@@ -1108,27 +1108,27 @@ wxBitmap wxImage::ConvertToBitmap() const
{
if( (*(ptdata++)!=r) | (*(ptdata++)!=g) | (*(ptdata++)!=b) )
{
*(ptbits++) = zero;
*(ptbits++) = zero;
*(ptbits++) = zero;
*(ptbits++) = one;
*(ptbits++) = one;
*(ptbits++) = one;
}
else
{
*(ptbits++) = one;
*(ptbits++) = one;
*(ptbits++) = one;
*(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 );
*/
}