Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i have an app in vb.net 2010. on a windows 7 machine, the UI appears ok for up to 120 dpi (125%) since windows 7 by default enables "xp style dpi scaling" for dpi values equal or less than 120. for >120 dpi values the UI objects get misaligned and blurry unless user manually check (enable) the "xp style dpi scaling" option in display settings. for the same reason, the ".DpiX" returns correct number for <=120 dpi, while returns 96 for any >120 dpi value, unless, again, i manually enable that option.

i am wondering if there is any way *for example, through manifest) to force windows use the xp style dpi scaling for every dpi value? if anyone knows how to do that, please help me by that.

thanks Ali

share|improve this question
    
i just found out that what "xp style dpi scaling" actually does is disabling "dpi virtualization". so, i am basically looking for a way to disable dpi virtualization through my code/manifest. –  Ali Jun 25 '13 at 20:27

1 Answer 1

Try using the following setting in your manifest

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>

If you wish to change Windows' settings, you will have to manipulate the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI registry key.

If font scaling is critical for your application, consider rendering your own text and scale it using ScaleTransform

share|improve this answer
    
thanks hanxue. but i had tried this before and got the same results. i think your comment is regarding declaring the app dpi-aware, while my problem is due to dpi virtualization. –  Ali Jun 25 '13 at 20:19
    
@Ali even changing the registry key to get Windows to use xp style dpi scaling does not work? –  hanxue Jun 25 '13 at 20:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.