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:
- What is the best practice to get custom DPI mode?
- Is the fact I am getting a constant 96 no matter what I what the percebtage is means I missing somthing?
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.