Derry Bryson
Fix to wxPrinterDC::DrawBitmap() to print 24 bit bitmaps
at 24 bits rather than 8 bits.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16996
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
provided in wxFontData
- Added wxTE_LEFT, wxTE_CENTRE and wxTE_RIGHT flags for text
control alignment.
provided in wxFontData
- Added wxTE_LEFT, wxTE_CENTRE and wxTE_RIGHT flags for text
control alignment.
+- Bitmap printing uses 24 bits now, not 8.
#define GDI_ERROR -1
#endif
#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)
void wxPrinterDC::DoDrawBitmap(const wxBitmap &bmp,
wxCoord x, wxCoord y,
bool useMask)
BITMAPINFO *info = (BITMAPINFO *) malloc( sizeof( BITMAPINFOHEADER ) + 256 * sizeof(RGBQUAD ) );
memset( info, 0, sizeof( BITMAPINFOHEADER ) );
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 );
void* bits = malloc( iBitsSize );
info->bmiHeader.biWidth = width;
info->bmiHeader.biHeight = height;
info->bmiHeader.biPlanes = 1;
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;
info->bmiHeader.biBitCount = 8;
info->bmiHeader.biCompression = BI_RGB;
ScreenHDC display;
info->bmiHeader.biCompression = BI_RGB;
ScreenHDC display;