Mike Chaney's Tech Corner
May 28, 2024, 10:59:52 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Qimage registration expired? New lifetime licenses are only $59.99!
   Home   Help Search Login Register  

Professional Photo Printing Software for Windows
Print with
Qimage and see what you've been missing!
Pages: [1]
Author Topic: August 2015: High DPI Aware  (Read 20703 times)
Forum Superhero
Posts: 4142

View Profile Email
« on: August 11, 2015, 01:34:30 PM »

Qimage Ultimate 2015.110 is now high DPI aware: http://www.ddisoftware.com/qimage-u

About High DPI Aware
Qimage Ultimate 2016.110 is the result of many hours getting QU ready for high res monitors.  Making QU high DPI aware is a task that has been high on our list since the initial release of the 2016 edition because 1920x1080 is quickly becoming the "least common denominator" for monitor resolution.  People are now moving up to Quad HD (2560x1440) and 4K (3840x2160) monitors and while Windows 10 is ready for the task, most software applications are not there yet.  We're now ahead of the curve with 1016.110 so I thought I'd share some background on high DPI aware and what is means to Windows applications.

Windows XP Through Windows 7
Windows XP through Windows 7 handle scaling in the simplest possible way, by increasing system font sizes and system icons only.  So when you set your display properties to 125% or 150%, Windows only scales system fonts and system icons like your desktop icons by the amount chosen.  This resulted in all sorts of problems with Windows apps because if the app is marked as "high DPI aware" in it's manifest (header in the executable file), the application reads (or should read) the scaling factor and increase the size of each open window in the app and subsequently increase the size of the fonts on that window.  This created a myriad of problems with various apps like text labels overlapping controls, controls being off the edge of the window, and so on.  I'm sure we've all seen that behavior in various apps as very few developers took the time to do it right.  If, on the other hand, the app identifies itself as non high DPI aware, the app does nothing and Windows does the scaling in a similar fashion but with Windows not knowing how to scale buttons, the icons on the buttons, etc. this result is often worse.  Enter Windows 8 and 10 to "solve" these problems.

Windows 8/10
Windows 8 and 10 employ a clever trick for scaling applications that mark themselves as non high DPI aware.  If a developer doesn't want to go to the trouble (and believe me, it's a lot of work) to do proper scaling inside the app and they mark their app as non high DPI aware thinking Windows will handle the scaling for them, Windows actually "fakes" the screen resolution sent to the app by making the screen look lower resolution, forcing the app to render lower resolution windows.  Windows itself then takes the lower resolution windows and scales them up to your screen resolution.  For example, if you are running 4K monitor and you have your display properties set to 200% scaling, non high DPI aware apps will be told that the screen size is 1920 x 1080 and the app will behave as if it has a 1920 x 1080 screen.  The windows in that app are all rendered at 1920 x 1080 and Windows scales them up to the full 3840 x 2160.  This takes care of the problem with overlapping and misplaced controls but it creates other problems: blurry windows, blurry text, and blurry controls because the entire window is being upsampled by 2x.  Let's take a moment to contemplate what that means for non high DPI aware apps.  In an application like Qimage Ultimate where you want to view and edit your photos in your monitor's full 4K glory, this type of scaling means that every image you view on your screen will be 1/4 resolution because the app is rendering a 1920 x 1080 image and Windows is then scaling it up by 2x!  So this is clearly not what we want in an image/photo based app.  The new Windows scaling routines, while they make apps "usable" by properly scaling all windows and dialogs, are not built to actually make use of your monitor's actual resolution.

High DPI, Doing it Right!
For an application to truly make use of all those extra pixels, it must declare itself high DPI aware so that Windows doesn't do any (internal) scaling and the app must take care of the scaling internally.  As above, an app that is non high DPI aware on a 4K monitor with display scaling set to 200% will render a 10 point font and Windows (8 and 10) will then scale the entire UI up by 2x, making the font appear to be a 20 point font.  But the font was still rendered at 10 points and is then upsampled to 20 points, making the font look pixelated or blurry.  To do the job right, the application must mark itself as high DPI aware so that Windows itself does no internal scaling of components, and then the application can read the actual screen resolution or scaling factor and then produce an actual 20 point font on its controls and windows!  Doing this, the font is rendered at full resolution.

But there's a lot more to it than just rendering fonts at a scaling factor and increasing window size.  Buttons on windows are graphic controls and can be scaled appropriately but often, a certain text font doesn't have an integer multiple when scaled, so if you're not meticulous with what you are doing, some text on a window may overlap other controls like buttons or be too small to align properly.  In addition, you can increase the size of a button on a window to 200%, but what about it's icon?  You don't want a big button with a (still) tiny icon.  In Qimage Ultimate 2015.110, we've taken the time to write a special icon resampling method that can resample all icons and menu images to the proper scaling factor, transparent mask included, so that the icons scale with near perfect precision.  And what if a user wants a scaling factor for your app that is a little different from what they are using in Windows?  Often, users are forced to pick a "non optimal" scaling factor in their display properties because they know some apps that they frequently use will not behave properly at higher scaling.  So in Qimage Ultimate, we provide a user override that allows the user to pick a size anywhere from 100% to 250%.  This presents new developer-challenges because it allows users to pick scaling factors that may make controls gargantuan on some monitors... but they still have to work.  Some users may have impaired vision and would choose a much larger scaling factor for instance.

All in all, for a major application, it can be hundreds of hours of work but the results speak for themselves.  We are happy that Qimage Ultimate 2016.110 is one of the few applications that will make full use of your high res monitor!

Pages: [1]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Security updates 2022 by ddisoftware, Inc.