7

In windows 7 environment, the value of PixelsPerInch varies while switching between Win7 and classic themes. Strangely, while having the current windows OS active on a 150% scale, in Win7 theme PixelsPerInch returns a value of 96.

The attached table will elaborate further.enter image description here

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Johny
  • 419
  • 4
  • 15

1 Answers1

11

Your application has not declared itself to be high DPI aware. As such, it is subject to DPI virtualization. That explains why 150% scaling gives a DPI of 96 when themed.

Why don't you get DPI of 96 when in the classic theme? Well, that's because DPI virtualization relies on DWM, and DWM is not active when you are using the classic theme.

I suspect that all of this is news to you. In which case you need to start by reading the MSDN topics that begin here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd464646.aspx

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • While reading that pay particular attention to what a Manifest file is, and what it might contain that might tell Windows what level of DPI awareness you want. Be aware that it's a lot easier to configure custom manifests in delphi XE7 than in delphi 2010. – Warren P Jan 28 '15 at 22:58
  • related: http://stackoverflow.com/questions/5080380/troubleshooting-dpi-virtualization-and-dpi-aware-applications-in-windows-vista – Warren P Jan 28 '15 at 22:59
  • Thanks @David Heffernan. After some reading, the issue has been clarified. – Johny Jan 29 '15 at 09:34
  • @ Warren P after reading the link you have posted, i failed to see how "it's a lot easier to configure custom manifests in delphi XE7 than in delphi 2010" – Johny Jan 29 '15 at 09:36
  • 1
    That's the normal way to include a manifest. Massively preferable to an external file which can easily become disconnected. So yes, link a manifest resource to your executable. – David Heffernan Jan 29 '15 at 10:59