My WPF app is per-monitor dpi-aware out of the box. I was not expecting that?

后端 未结 2 698
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-08 10:07

I am a bit confused about per-monitor dpi-aware in WPF. I thought you need to do some work to make your windows scale properly on different monitors (as described in Developing

相关标签:
2条回答
  • 2021-02-08 10:41

    What you see is an example of System scaling when one app window moves to a different monitor with a different DPI. That is because WPF apps are by-default System DPI Aware. As a result, if you notice carefully, you'll see WPF visuals/text gets blurred when the target DPI is higher or they look fuzzy when the target DPI is lower. Also, note that monitor resolution does not matter for WPF apps, since WPF is device resolution agnostic (it's measurement unit is Device independent Pixels).

    Good news : .NET 4.6.2 preview just got released and it hasPer Monitor DPI Awareness out of the box. Check out the developer guide and samples here :

    https://github.com/Microsoft/WPF-Samples/tree/master/PerMonitorDPI

    0 讨论(0)
  • 2021-02-08 11:03

    Continuing the conversation from comments.
    Yes that is the same for Windows 8.1.
    And here is the note from your linked post

    Windows Presentation Foundation (WPF) applications are by default system DPI-aware.

    HTH

    0 讨论(0)
提交回复
热议问题