X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0cbff1201aa47e2b73ec90a97886f18e88270ea6..aa6ca3dcc9ad03a973dc6fc80e9c66c408b2c27d:/src/msw/dcprint.cpp diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 76b581fa9f..ed38d9fe64 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -194,7 +194,7 @@ bool wxPrinterDC::StartDoc(const wxString& message) if (ret <= 0) { DWORD lastError = GetLastError(); - wxLogDebug(wxT("wxDC::StartDoc failed with error: %d\n"), lastError); + wxLogDebug(wxT("wxDC::StartDoc failed with error: %ld\n"), lastError); } #endif @@ -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; @@ -475,7 +487,7 @@ bool wxPrinterDC::DoBlit(wxCoord xdest, wxCoord ydest, wxDC *source, wxCoord xsrc, wxCoord ysrc, int WXUNUSED(rop), bool useMask, - wxCoord xsrcMask, wxCoord ysrcMask) + wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask)) { bool success = TRUE;