Applied [ 671333 ] wxPrinterDC::DoBlit() 24 bit fix (2.4)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-01-24 12:31:41 +00:00
parent 9370c6ba12
commit 9e691dd614

View File

@@ -530,7 +530,11 @@ bool wxPrinterDC::DoBlit(wxCoord xdest, wxCoord ydest,
height = bmp.GetHeight(); height = bmp.GetHeight();
BITMAPINFO *info = (BITMAPINFO *) malloc( sizeof( BITMAPINFOHEADER ) + 256 * sizeof(RGBQUAD ) ); BITMAPINFO *info = (BITMAPINFO *) malloc( sizeof( BITMAPINFOHEADER ) + 256 * sizeof(RGBQUAD ) );
int iBitsSize = ((width + 3 ) & ~3 ) * height; #if wxUSE_DRAWBITMAP_24BITS
int iBitsSize = (((width * 3) + 3 ) & ~3 ) * height;
#else
int iBitsSize = ((width + 3 ) & ~3 ) * height ;
#endif
void* bits = malloc( iBitsSize ); void* bits = malloc( iBitsSize );
@@ -540,7 +544,11 @@ bool wxPrinterDC::DoBlit(wxCoord xdest, wxCoord ydest,
info->bmiHeader.biWidth = width; info->bmiHeader.biWidth = width;
info->bmiHeader.biHeight = height; info->bmiHeader.biHeight = height;
info->bmiHeader.biPlanes = 1; info->bmiHeader.biPlanes = 1;
#if wxUSE_DRAWBITMAP_24BITS
info->bmiHeader.biBitCount = 24;
#else
info->bmiHeader.biBitCount = 8; info->bmiHeader.biBitCount = 8;
#endif
info->bmiHeader.biCompression = BI_RGB; info->bmiHeader.biCompression = BI_RGB;
ScreenHDC display; ScreenHDC display;