Menu

Igor, please, set DPI-awareness

Alvaro
2011-04-02
2012-12-07
  • Alvaro

    Alvaro - 2011-04-02

    People with bad vision or some people with HTPCs connected to an HDTV, increase the DPI resolution of Windows to provide bigger text easier to read from a distance or for their visual problems (to 150% or more). Windows Vista and 7 do a good job in enlarging programs after that setting, but only when programs have been specially. I recently noticed in such a PC that 7-Zip and a few other free programs displayed badly enlarged, as if a "digital zoom" is applied (pixels stretched and blurred). At the same time I noticed that the video player MPC-HC suffered the same, but solved it when they switched to Visual Studio 2010.

    The reason is that programs need to specify "High-DPI awareness" to Windows in order to be nicely scaled or "DPI Virtualization" will occur. And it turns out that Visual Studio 2010 makes this by default to all MFC applications (which I know is not the case for 7-Zip).

    Anyway it can be set explicitly as is explained here:

    http://msdn.microsoft.com/en-us/library/dd464660%28VS.85%29.aspx

    At the very least, I think calling "SetProcessDPIAware();" should do it. But more is explained here:

    http://msdn.microsoft.com/en-us/library/ms633543.aspx

    Best regards,

     
  • Alvaro

    Alvaro - 2011-04-02

    Here is a screenshot so you see what I mean. (Please look at it at full resolution)

    http://i.imgur.com/9fij5.png

    It shows 7zip at the top, old MPC-HC bottom-left, new MPC-HC bottom-right. All from a Windows 7 mini-PC attached to a large HDTV, at > 150% DPI setting. That text size is nice to read at a distance in the living room.

     
  • Igor Pavlov

    Igor Pavlov - 2011-04-03

    I don't use Vista/7 now.
    Maybe I'll check it later.

     
  • Robert S

    Robert S - 2011-04-12

    you can try my build from
    http://atombomb.no-ip.org/blog/?p=238
    it should be dpi aware, the only change needed was in manifest files for 7zg.exe and 7zfm.exe so it should work without problems on older versions of windows

     
  • Igor Pavlov

    Igor Pavlov - 2011-04-14

    roberts8:
    What exact change in manifest do you mean?

     
  • Robert S

    Robert S - 2011-04-14

    I changed 7zFM.exe.manifest from

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="7-Zip.7-Zip.7zFM" type="win32"/>
        <description>
            7-Zip File manager.
        </description>
        <dependency> 
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>
    

    to

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="7-Zip.7-Zip.7zFM" type="win32">
        </assemblyIdentity>
        <description>
            7-Zip File manager.
        </description>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*">
                </assemblyIdentity>
            </dependentAssembly>
        </dependency>
        <asmv3:application>
            <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
                <dpiAware>
                    true
                </dpiAware>
            </asmv3:windowsSettings>
        </asmv3:application
    </assembly>
    

    and 7zG.exe.manifest from

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="7-Zip.7-Zip.7zG" type="win32"/>
        <description>
            7-Zip GUI.
        </description>
        <dependency> 
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
            </dependentAssembly>
        </dependency>
    </assembly>
    

    to

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
        <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="7-Zip.7-Zip.7zG" type="win32">
        </assemblyIdentity>
        <description>
            7-Zip GUI.
        </description>
        <dependency>
            <dependentAssembly>
                <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*">
                </assemblyIdentity>
            </dependentAssembly>
        </dependency>
        <asmv3:application>
            <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
                <dpiAware>
                    true
                </dpiAware>
            </asmv3:windowsSettings>
        </asmv3:application>
    </assembly>
    
     
  • Igor Pavlov

    Igor Pavlov - 2011-04-15

    roberts8:
    I've changed manifest in 7-zip 9.21.02.
    I tried to set 150% in Win7. But I don't see any difference. Maybe something wrong with my system. It doesn't look good in any case.

    Can somebody show some screenshot that shows the difference between DPI-aware and non-DPI-aware application?

     
  • Igor Pavlov

    Igor Pavlov - 2011-04-15

    what about my new 9.21.02?

     
  • Robert S

    Robert S - 2011-04-15
     
  • Alvaro

    Alvaro - 2011-04-15

    Thank you all, I think that should do it. I don't have easy access to a Win7 PC to try but I'll do it. The person I was refering to has the screen at 200% or near (I think) in a full HD 32" screen and even needs the magnifier tool to read.

     

Log in to post a comment.