From 70d8341a674582d2c1b9e99b7ea25c7d1110d8e6 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 12 Dec 2011 14:34:48 +0100 Subject: [PATCH] gdi32: Pass the correct depth to PutImage for SetBitmapBits on a DIB. --- dlls/gdi32/bitmap.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index af9012b45d4..0d637ec833b 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -481,7 +481,7 @@ LONG WINAPI SetBitmapBits( /* query the color info */ info->bmiHeader.biSize = sizeof(info->bmiHeader); info->bmiHeader.biPlanes = 1; - info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel; + info->bmiHeader.biBitCount = bmp->dib ? bmp->dib->dsBmih.biBitCount : bmp->bitmap.bmBitsPixel; info->bmiHeader.biCompression = BI_RGB; info->bmiHeader.biXPelsPerMeter = 0; info->bmiHeader.biYPelsPerMeter = 0; @@ -494,11 +494,9 @@ LONG WINAPI SetBitmapBits( if (!err || err == ERROR_BAD_FORMAT) { - info->bmiHeader.biPlanes = 1; - info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel; - info->bmiHeader.biWidth = bmp->bitmap.bmWidth; - info->bmiHeader.biHeight = -dst.height; - info->bmiHeader.biSizeImage = dst.height * dst_stride; + info->bmiHeader.biWidth = bmp->bitmap.bmWidth; + info->bmiHeader.biHeight = -dst.height; + info->bmiHeader.biSizeImage = dst.height * dst_stride; err = funcs->pPutImage( NULL, hbitmap, clip, info, &src_bits, &src, &dst, SRCCOPY ); } if (err) count = 0;