Module: wine Branch: master Commit: 5f46f701c5755da3502005477c2929891785a6e8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5f46f701c5755da3502005477c...
Author: Vincent Povirk vincent@codeweavers.com Date: Wed Jul 27 16:29:53 2011 -0500
windowscodecs: Implement IcoFrameDecode_GetResolution.
---
dlls/windowscodecs/icoformat.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index fcb5d49..b9e7c61 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -69,6 +69,7 @@ typedef struct { IWICBitmapFrameDecode IWICBitmapFrameDecode_iface; LONG ref; UINT width, height; + double dpiX, dpiY; BYTE *bits; } IcoFrameDecode;
@@ -155,8 +156,14 @@ static HRESULT WINAPI IcoFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface static HRESULT WINAPI IcoFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, double *pDpiX, double *pDpiY) { - FIXME("(%p,%p,%p): stub\n", iface, pDpiX, pDpiY); - return E_NOTIMPL; + IcoFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface); + + *pDpiX = This->dpiX; + *pDpiY = This->dpiY; + + TRACE("(%p) -> (%f,%f)\n", iface, *pDpiX, *pDpiY); + + return S_OK; }
static HRESULT WINAPI IcoFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, @@ -276,6 +283,9 @@ static HRESULT ReadIcoDib(IStream *stream, IcoFrameDecode *result) IWICBitmapSource_Release(source); }
+ if (SUCCEEDED(hr)) + hr = IWICBitmapFrameDecode_GetResolution(source, &result->dpiX, &result->dpiY); + IWICBitmapFrameDecode_Release(framedecode); }
@@ -402,6 +412,9 @@ static HRESULT ReadIcoPng(IStream *stream, IcoFrameDecode *result) hr = IWICBitmapFrameDecode_GetSize(sourceFrame, &result->width, &result->height); if (FAILED(hr)) goto end; + hr = IWICBitmapFrameDecode_GetResolution(sourceFrame, &result->dpiX, &result->dpiY); + if (FAILED(hr)) + goto end; result->bits = HeapAlloc(GetProcessHeap(), 0, 4 * result->width * result->height); if (result->bits == NULL) {