Jump to content

Conclusions of DPI Awareness for Compiled GUI


qwert
 Share

Recommended Posts

After weeks of investigating the problem of how to support HiDPI monitors, I've found that it remains a confusing maze of situations versus settings. A major culprit is that the operating system uses different methods in different current releases ... Win7, Win8.1 and Win10 ... and also between 32-bit and 64-bit versions ... so, people who pose a solution for one, find that it doesn’t quite work in another.

The best overview that I have found is here. (... although I readily admit I haven’t tried even half of the settings vs OS combinations.)

So what’s a reasonable solution for a compiled AutoIt script? Apparently this:

Current HiDPI Prescription:

  • Declare a compiled script DPI Aware by using #AutoIt3Wrapper_Res_HiDpi=Y
  • Then, in the first section of the script, detect the monitor’s scaling and adjust font size variables that must be used in statements when creating controls.

But any embedded graphic elements (JPGs, PNGs, etc.) used on the GUI will be upscaled and will be blurry. There doesn’t seem to be a way around this.

A magic bullet solution for some scripts is simply to circumvent all upscaling by using the Properties >> Compatibility >> Disable Display Scaling on the compiled EXE. But, alas, I have found no way to force this “checked” for a script. The user must do it ... which is unacceptably messy for distributed software.

Given that the trend is toward higher res monitors, I’ve begun using slightly larger fonts in many GUIs so that they’re not uncomfortably small in the 125% mode.

The questions I have at this moment:

  1. What exactly does #AutoIt3Wrapper_Res_HiDpi=Y do?  (If it's setting something in "the manifest", please explain what/why.)
  2. Can the Disable Display Scaling be set by any scripted means?

(BTW, it doesn’t work to set “disable” on the EXE before distribution. The setting is apparently in the runtime settings on individual PCs.)

If I’m wrong on any of my assumptions or any of my conclusions, please point them out and point me (everyone!) to the proper resources.

 

Another opinion:

Final verdict (at least by me): #AutoIt3Wrapper_Res_HiDpi=Y does work, and it's good thing, but it just doesn't work the way we hoped it would. There just is no magic bullet, and no substitute for hard work.Kilmatead, 2015

And the associated property panel from Win7:

Disable.png

Link to comment
Share on other sites

2 hours ago, qwert said:

But any embedded graphic elements (JPGs, PNGs, etc.) used on the GUI will be upscaled and will be blurry. There doesn’t seem to be a way around this.

What about manually scaling the images using the DPI factor? I can imagine that the quality is better than built-in method.

 

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Quote

What about manually scaling the images using the DPI factor?

Thanks for your response.

Wouldn't that require twice the number of pre-built images (or 3 times, to also support 150%) available to the runtime?

Or are you suggesting that the script use GDI+ calls to scale each of them as they're needed?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...