System.Drawing.Graphics.DpiX always return 96

前端 未结 3 807
隐瞒了意图╮
隐瞒了意图╮ 2021-01-24 07:37

I have vb.net winform app that has AutoScaleMode = dpi AutoScale = false AutoSize = true

I\'ve signed off after changing DPI setting. I also tried restarting the machine

3条回答
  •  误落风尘
    2021-01-24 07:53

    I found solution. My app's manifest has to say it is dpiAware. Because I am trying to detect high DPI and show a warning message box and not really trying to make my app dpi aware, I couldn't do that. You can get dpi aware information from registry: HKEY_CURRENT_USER\Control Panel\Desktop LogPixels.

    If you are using default, you won't have the key. Changing DPI setting will create one.

提交回复
热议问题