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:
@@ -1108,27 +1108,27 @@ wxBitmap wxImage::ConvertToBitmap() const
|
|||||||
{
|
{
|
||||||
if( (*(ptdata++)!=r) | (*(ptdata++)!=g) | (*(ptdata++)!=b) )
|
if( (*(ptdata++)!=r) | (*(ptdata++)!=g) | (*(ptdata++)!=b) )
|
||||||
{
|
{
|
||||||
*(ptbits++) = zero;
|
*(ptbits++) = one;
|
||||||
*(ptbits++) = zero;
|
*(ptbits++) = one;
|
||||||
*(ptbits++) = zero;
|
*(ptbits++) = one;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*(ptbits++) = one;
|
*(ptbits++) = zero;
|
||||||
*(ptbits++) = one;
|
*(ptbits++) = zero;
|
||||||
*(ptbits++) = one;
|
*(ptbits++) = zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hbitmap = ::CreateBitmap( (WORD)width, (WORD)height, 1, 1, NULL );
|
hbitmap = ::CreateBitmap( (WORD)width, (WORD)height, 1, 1, NULL );
|
||||||
::SetDIBits( hdc, hbitmap, 0, (WORD)height, lpBits, lpDIBh, DIB_RGB_COLORS);
|
::SetDIBits( hdc, hbitmap, 0, (WORD)height, lpBits, lpDIBh, DIB_RGB_COLORS);
|
||||||
wxMask bmpmask;
|
wxMask *mask = new wxMask();
|
||||||
bmpmask.SetMaskBitmap( (WXHBITMAP) hbitmap );
|
mask->SetMaskBitmap( (WXHBITMAP) hbitmap );
|
||||||
bitmap.SetMask( &bmpmask );
|
bitmap.SetMask( mask );
|
||||||
|
|
||||||
/* The following can also be used but is slow to run
|
/* The following can also be used but is slow to run
|
||||||
wxColour colour( GetMaskRed(), GetMaskGreen(), GetMaskBlue());
|
wxColour colour( GetMaskRed(), GetMaskGreen(), GetMaskBlue());
|
||||||
wxMask bmpmask( bitmap, colour );
|
wxMask *mask = new wxMask( bitmap, colour );
|
||||||
bitmap.SetMask( &bmpmask );
|
bitmap.SetMask( mask );
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user