From 73b9c8638486428de685a75fcd495748e4f88603 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 22 Dec 2011 21:18:30 +0100 Subject: [PATCH] gdi32: Always use proper RGB colors for monochrome DDB pattern brushes. --- dlls/gdi32/dibdrv/objects.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index 85fbbbc13c9..96596dfe642 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -1589,16 +1589,24 @@ static BOOL select_pattern_brush( dibdrv_physdev *pdev, BOOL *needs_reselect ) if (pattern.bit_count == 1 && !pattern.color_table) { /* monochrome DDB pattern uses DC colors */ - COLORREF color = GetTextColor( pdev->dev.hdc ); + DWORD pixel; + BOOL got_pixel; + COLORREF color; + + color = make_rgb_colorref( pdev->dev.hdc, &pdev->dib, GetTextColor( pdev->dev.hdc ), + &got_pixel, &pixel ); color_table[0].rgbRed = GetRValue( color ); color_table[0].rgbGreen = GetGValue( color ); color_table[0].rgbBlue = GetBValue( color ); color_table[0].rgbReserved = 0; - color = GetBkColor( pdev->dev.hdc ); + + color = make_rgb_colorref( pdev->dev.hdc, &pdev->dib, GetBkColor( pdev->dev.hdc ), + &got_pixel, &pixel ); color_table[1].rgbRed = GetRValue( color ); color_table[1].rgbGreen = GetGValue( color ); color_table[1].rgbBlue = GetBValue( color ); color_table[1].rgbReserved = 0; + pattern.color_table = color_table; pattern.color_table_size = 2; *needs_reselect = TRUE; -- 2.11.4.GIT