1. some fixes for the problems reported by BoundsChecker

2. filled rectangles without outline are one pixel taller/wider


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-01 01:22:00 +00:00
parent 70862fa81b
commit 0bafad0cf4
3 changed files with 83 additions and 80 deletions

View File

@@ -857,7 +857,7 @@ wxBitmap wxImage::ConvertToBitmap() const
if( HasMask() )
{
hbitmap = ::CreateBitmap( (WORD)width, (WORD)bmpHeight, 1, 1, NULL );
::SelectObject( memdc, hbitmap);
HGDIOBJ hbmpOld = ::SelectObject( memdc, hbitmap);
if( numDIB == 1 ) height = bmpHeight;
else height = sizeLimit/bytePerLine;
lpDIBh->bmiHeader.biHeight = (DWORD)(-height);
@@ -917,10 +917,11 @@ wxBitmap wxImage::ConvertToBitmap() const
wxMask *mask = new wxMask( bitmap, colour );
bitmap.SetMask( mask );
*/
::SelectObject( memdc, hbmpOld );
}
// free allocated resources
::SelectObject( memdc, 0 );
::DeleteDC( memdc );
::ReleaseDC(NULL, hdc);
free(lpDIBh);