Trying to my Delphi 2010 application more user freindly in high DPI modes in Windows 7 I have been trying several methods to retrive PixelsPerInch and compare to 96. Alas, no matter what I tried I always get 96. My questions are:
Here is what I had tried
dpiX := Form1.PixelsPerInch
and
dpiX := Screen.PixelsPerInch
and finally:
D2DFactoryOptions.DebugLevel := D2D1_DEBUG_LEVEL_NONE;
pD2DFactoryOptions := @D2DFactoryOptions;
if D2D1CreateFactory(
D2D1_FACTORY_TYPE_SINGLE_THREADED,
IID_ID2D1Factory,
PD2DFactoryOptions,
D2DFactory
) <> S_OK then exit;
D2DFactory.GetDesktopDpi(dpiX, dpiY)
Care to guess? that's right dpiX is a constant 96 in 100%, 125% and 150%
Please advice.
I think you need to mark your application as being high DPI aware by including this in your application manifest:
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
Details on declaring DPI awareness are given here.
It seems like you are currently falling back to what is called DPI Virtualization.