[PATCH 3/3] oleaut32: Use common helper for masked bitmaps to render an icon.

Dmitry Timoshkov dmitry at baikal.ru
Tue Jul 17 23:25:21 CDT 2018


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/oleaut32/olepicture.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index aa82b057ee..0ef0ecfeb6 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -711,9 +711,18 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
   }
 
   case PICTYPE_ICON:
-    FIXME("Not quite correct implementation of rendering icons...\n");
-    DrawIconEx(hdc, x, y, This->desc.u.icon.hicon, cx, cy, 0, NULL, DI_NORMAL);
+  {
+    ICONINFO info;
+
+    if (!GetIconInfo(This->desc.u.icon.hicon, &info))
+        return E_FAIL;
+
+    render_masked_bitmap(This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, info.hbmMask, info.hbmColor);
+
+    DeleteObject(info.hbmMask);
+    if (info.hbmColor) DeleteObject(info.hbmColor);
     break;
+  }
 
   case PICTYPE_METAFILE:
   {
-- 
2.17.1




More information about the wine-devel mailing list