Dmitry Timoshkov : oleaut32: Use common helper for masked bitmaps to render an icon.

Alexandre Julliard julliard at winehq.org
Fri Aug 24 13:59:15 CDT 2018


Module: wine
Branch: master
Commit: 3dcd048175914e7b5c372b5dc201c517028f0f64
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3dcd048175914e7b5c372b5dc201c517028f0f64

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Fri Aug 24 16:04:09 2018 +0800

oleaut32: Use common helper for masked bitmaps to render an icon.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 aa82b05..0ef0ecf 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:
   {




More information about the wine-cvs mailing list