Shi Quan He (of Corel) The implementation of StretchBlt in WINE does not use the foreground and background color when a bitmap is copied from mono to mono. This is not the case in the actual implementation under Windows but MSDN did not document it.
diff --git a/graphics/x11drv/bitblt.c b/graphics/x11drv/bitblt.c index 396d363..50bc3dc 100644 --- a/graphics/x11drv/bitblt.c +++ b/graphics/x11drv/bitblt.c
@@ -894,8 +894,21 @@ if (!X11DRV_PALETTE_XPixelToPalette || (dcDst->w.bitsPerPixel == 1)) /* monochrome -> monochrome */ { - XCopyArea( display, physDevSrc->drawable, pixmap, gc, - visRectSrc->left, visRectSrc->top, width, height, 0, 0); + if (dcDst->w.bitsPerPixel == 1) + { + /* MSDN says if StretchBlt must convert a bitmap from monochrome + to color or vice versa, the forground and background color of + the device context are used. In fact, it also applies to the + case when it is converted from mono to mono. */ + XSetBackground( display, gc, physDevDst->textPixel ); + XSetForeground( display, gc, physDevDst->backgroundPixel ); + XCopyPlane( display, physDevSrc->drawable, pixmap, gc, + visRectSrc->left, visRectSrc->top, + width, height, 0, 0, 1); + } + else + XCopyArea( display, physDevSrc->drawable, pixmap, gc, visRectSrc + ->left, visRectSrc->top, width, height, 0, 0); } else /* color -> color */ {