title: Getting custom DPI percentage in Delphi
body: <p>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:</p>
  
  <ol>
  <li>What is the best practice to get custom DPI mode?</li>
  <li>Is the fact I am getting a constant 96 no matter what I what the percebtage is means I missing somthing?</li>
  </ol>
  
  <p>Here is what I had tried</p>
  
  <pre><code>dpiX := Form1.PixelsPerInch
  </code></pre>
  
  <p>and</p>
  
  <pre><code>dpiX := Screen.PixelsPerInch
  </code></pre>
  
  <p>and finally:</p>
  
  <pre><code>D2DFactoryOptions.DebugLevel := D2D1_DEBUG_LEVEL_NONE;
  pD2DFactoryOptions := @D2DFactoryOptions;
  if D2D1CreateFactory(
      D2D1_FACTORY_TYPE_SINGLE_THREADED,
      IID_ID2D1Factory,
      PD2DFactoryOptions,
      D2DFactory
      ) &lt;&gt; S_OK then exit;
  D2DFactory.GetDesktopDpi(dpiX, dpiY)
  </code></pre>
  
  <p>Care to guess? that's right dpiX is a constant 96 in 100%, 125% and 150%</p>
  
  <p>Please advice.</p>