Search code examples
windows-store-appswinrt-xamlscreen-resolutionuwp

Why does DisplayInformation.RawPixelsPerViewPixel = .83 for Windows 8.1 apps in Windows 10?


When I run my Windows 8.1 targeted app in Windows 10, RawPixelsPerViewPixel=0.83 and everything is slightly scaled down.

If I target the same app to Windows 10 (create a Universal Windows App), then RawPixelsPerViewPixel=1 and everything is slightly larger.

DisplayInformation.LogicalDpi also changes from 79.63 to 96 when I switch between the Windows 8.1 and Universal Windows App.

The app looks better on Windows 10 if it is scaled to .83, and I want to re-target to Windows 10 for the new APIs. I don't want to have to resize everything though. Is there anyway to control or change this value? How is it calculated and why does it change?

I want to continue supporting Windows 8.1 and Windows 10. Currently I'm going through and externalizing all of the widths/heights/margins/fonts so the Windows 8.1 target can remain the same size while I manually reduce the size of everything in the Windows 10 target. Is there a better way of doing this?


Solution

  • I was running it on a Windows 10 VM. After running it on a normal Windows 10 installation, the 8.1 app is not auto-resized and doesn't have a weird RawPixelsPerViewPixel or LogicalDpi. I'm just going to chalk it up to the VM.