From 90d8ad03373d38e8f9bd00ef44d3b912ea989c49 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Tue, 10 Jul 2012 16:33:06 +0000 Subject: [PATCH] Add comment SVN revision: 73538 --- .../src/lib/ecore_evas/ecore_evas_win32.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_win32.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_win32.c index dde2e21b8e..59d6ed81f3 100644 --- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_win32.c +++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_win32.c @@ -1039,6 +1039,26 @@ _ecore_evas_win32_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi) if (xdpi) *xdpi = GetDeviceCaps(dc, LOGPIXELSX); if (ydpi) *ydpi = GetDeviceCaps(dc, LOGPIXELSY); + /* + * Alternative (to test) + int width_mm; + int height_mm; + int width_px; + int height_px; + + width_mm = GetDeviceCaps(dc, HORZSIZE); + height_mm = GetDeviceCaps(dc, VERTSIZE); + width_px = GetDeviceCaps(dc, HORZRES); + height_px = GetDeviceCaps(dc, VERTRES); + + *xdpi = (width_px * 254) / (width_mm * 10); + *ydpi = (height_px * 254) / (height_mm * 10); + + code with LOGPIXELS gives 96x96 + code with the computation gives 101x77 + + */ + ReleaseDC(NULL, dc); }