dgurok
Joined: 26 May 2011 Posts: 66
|
Posted: Mon Sep 21, 2020 8:58 am Post subject: Problem with GetDeviceCaps (SCC) |
|
|
Early this year we updated our ftn95 compiler from version 7.10.0 to version 8.62.0. We have observed different behavior concerning C function "GetDeviceCaps" concerning parameters HORZRES, VERTRES, DESKTOPHORZRES and DESKTOPVERTRES. Parameters HORZRES and VERTRES provide wrong returns. They are identical to parameters returned when using DESKTOPHORZRES and DESKTOPVERTRES. In this case we are not able to recognize the correct scaling factor.
We use this code for returning the scaling factor under windows 10.
Code: | HDC desktopDc;
desktopDc = GetDC(NULL);
short virtualWidth = GetDeviceCaps(desktopDc, HORZRES);
virtualWidth = (short)(virtualWidth/8)*8;
short virtualHeight = GetDeviceCaps(desktopDc, VERTRES);
virtualHeight = (short)(virtualHeight/8)*8;
short physicalWidth = GetDeviceCaps(desktopDc, DESKTOPHORZRES);
short physicalHeight = GetDeviceCaps(desktopDc, DESKTOPVERTRES);
short dpi = (short)(96.0 * physicalWidth / virtualWidth);
short sf = 100.0 / 96.0 * dpi; |
|
|