Nikolay Sivov : shell32: Implement IShellImageData::Draw().
Alexandre Julliard
julliard at winehq.org
Wed Feb 8 15:52:11 CST 2017
Module: wine
Branch: master
Commit: 258c5279dfb05293b227c8f8729a33c4c5faeb72
URL: http://source.winehq.org/git/wine.git/?a=commit;h=258c5279dfb05293b227c8f8729a33c4c5faeb72
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Feb 7 19:27:33 2017 +0300
shell32: Implement IShellImageData::Draw().
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/shell32/shellole.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c
index 8fb981c..d3d972b 100644
--- a/dlls/shell32/shellole.c
+++ b/dlls/shell32/shellole.c
@@ -920,10 +920,30 @@ static HRESULT WINAPI ShellImageData_Decode(IShellImageData *iface, DWORD flags,
static HRESULT WINAPI ShellImageData_Draw(IShellImageData *iface, HDC hdc, RECT *dest, RECT *src)
{
ShellImageData *This = impl_from_IShellImageData(iface);
+ GpGraphics *graphics;
+ HRESULT hr;
- FIXME("%p, %p, %s, %s: stub\n", This, hdc, wine_dbgstr_rect(dest), wine_dbgstr_rect(src));
+ TRACE("%p, %p, %s, %s\n", This, hdc, wine_dbgstr_rect(dest), wine_dbgstr_rect(src));
- return E_NOTIMPL;
+ if (!This->image)
+ return E_FAIL;
+
+ if (!dest)
+ return E_INVALIDARG;
+
+ if (!src)
+ return S_OK;
+
+ hr = gpstatus_to_hresult(GdipCreateFromHDC(hdc, &graphics));
+ if (FAILED(hr))
+ return hr;
+
+ hr = gpstatus_to_hresult(GdipDrawImageRectRectI(graphics, This->image, dest->left, dest->top, dest->right - dest->left,
+ dest->bottom - dest->top, src->left, src->top, src->right - src->left, src->bottom - src->top,
+ UnitPixel, NULL, NULL, NULL));
+ GdipDeleteGraphics(graphics);
+
+ return hr;
}
static HRESULT WINAPI ShellImageData_NextFrame(IShellImageData *iface)
More information about the wine-cvs
mailing list