X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b601c243f14c7e8f3f1c784d962fed81d118e1a..7b35aa40a06a160ae4a8650c5820880a020697e3:/src/msw/dcprint.cpp?ds=sidebyside diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index e2b917ed82..ed38d9fe64 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -416,6 +416,10 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) #define GDI_ERROR -1 #endif +// Just in case we want to go back to using 8 bits for +// any reason: set this to 0 for 8 bits. +#define wxUSE_DRAWBITMAP_24BITS 1 + void wxPrinterDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask) @@ -430,7 +434,11 @@ void wxPrinterDC::DoDrawBitmap(const wxBitmap &bmp, BITMAPINFO *info = (BITMAPINFO *) malloc( sizeof( BITMAPINFOHEADER ) + 256 * sizeof(RGBQUAD ) ); memset( info, 0, sizeof( BITMAPINFOHEADER ) ); - int iBitsSize = ((width + 3 ) & ~3 ) * height; +#if wxUSE_DRAWBITMAP_24BITS + int iBitsSize = ((width + 3 ) & ~3 ) * height * 3; +#else + int iBitsSize = ((width + 3 ) & ~3 ) * height ; +#endif void* bits = malloc( iBitsSize ); @@ -438,7 +446,11 @@ void wxPrinterDC::DoDrawBitmap(const wxBitmap &bmp, info->bmiHeader.biWidth = width; info->bmiHeader.biHeight = height; info->bmiHeader.biPlanes = 1; +#if wxUSE_DRAWBITMAP_24BITS + info->bmiHeader.biBitCount = 24; +#else info->bmiHeader.biBitCount = 8; +#endif info->bmiHeader.biCompression = BI_RGB; ScreenHDC display;