From c8a560cf2fa84368c011dec69d5ab319f6dc87fa Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Fri, 4 Sep 2009 10:23:30 -0500 Subject: [PATCH] gdiplus: disable alpha channel support for BMP images --- dlls/gdiplus/image.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 73b1dc8..28982a1 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1509,7 +1509,20 @@ static GpStatus decode_image_icon(IStream* stream, REFCLSID clsid, GpImage **ima static GpStatus decode_image_bmp(IStream* stream, REFCLSID clsid, GpImage **image) { - return decode_image_wic(stream, &CLSID_WICBmpDecoder, image); + GpStatus status; + GpBitmap* bitmap; + + status = decode_image_wic(stream, &CLSID_WICBmpDecoder, image); + + bitmap = (GpBitmap*)*image; + + if (status == Ok && bitmap->format == PixelFormat32bppARGB) + { + /* WIC supports bmp files with alpha, but gdiplus does not */ + bitmap->format = PixelFormat32bppRGB; + } + + return status; } static GpStatus decode_image_jpeg(IStream* stream, REFCLSID clsid, GpImage **image) -- 1.5.4.3