Huw Davies : ole32: Add support for retrieving extents of dib format.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Mar 25 10:13:22 CDT 2015
Module: wine
Branch: master
Commit: e410f273cd8c352e6a0b5e0f08c7ce786dc5cbfa
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e410f273cd8c352e6a0b5e0f08c7ce786dc5cbfa
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Mar 25 08:37:39 2015 +0000
ole32: Add support for retrieving extents of dib format.
---
dlls/ole32/datacache.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c
index 36c02dd..ff15d91 100644
--- a/dlls/ole32/datacache.c
+++ b/dlls/ole32/datacache.c
@@ -1846,6 +1846,41 @@ static HRESULT WINAPI DataCache_GetExtent(
return S_OK;
}
+ case CF_DIB:
+ {
+ BITMAPFILEHEADER *file_head;
+ BITMAPINFOHEADER *info;
+ LONG x_pels_m, y_pels_m;
+
+
+ if ((cache_entry->stgmedium.tymed != TYMED_HGLOBAL) ||
+ !((file_head = GlobalLock( cache_entry->stgmedium.u.hGlobal ))))
+ continue;
+
+ info = (BITMAPINFOHEADER *)(file_head + 1);
+
+ x_pels_m = info->biXPelsPerMeter;
+ y_pels_m = info->biYPelsPerMeter;
+
+ /* Size in units of 0.01mm (ie. MM_HIMETRIC) */
+ if (x_pels_m != 0 && y_pels_m != 0)
+ {
+ lpsizel->cx = info->biWidth * 100000 / x_pels_m;
+ lpsizel->cy = info->biHeight * 100000 / y_pels_m;
+ }
+ else
+ {
+ HDC hdc = GetDC( 0 );
+ lpsizel->cx = info->biWidth * 2540 / GetDeviceCaps( hdc, LOGPIXELSX );
+ lpsizel->cy = info->biHeight * 2540 / GetDeviceCaps( hdc, LOGPIXELSY );
+
+ ReleaseDC( 0, hdc );
+ }
+
+ GlobalUnlock( cache_entry->stgmedium.u.hGlobal );
+
+ return S_OK;
+ }
}
}
More information about the wine-cvs
mailing list