Thursday, June 14th, 2007

“XP Style DPI Scaling”

There’s an interesting little checkbox buried deep in the DPI scaling settings in Vista labeled “Use Windows XP style DPI Scaling”. From what I’ve read about the new desktop composer in Vista – un-checking this effectively turns on full DPI scaling for applications that don’t use newer resolution independent frameworks, and haven’t marked their apps as DPI scaling aware. Vista’s support for high resolution displays represent some interesting challenges for application developers who use older developer tools such as the MFC and Windows Forms. This checkbox option makes for a really useful little option for developers who need to check to make sure their apps are working well with the Vista Desktop.

Checking the option causes non-DPI scaling aware applications to be scaled similar to the way they would have been in XP – the application is told the default system font sizes and icon sizes are larger than the typical size you would find in 96 DPI. If the application is well designed, this won’t have much of an effect on the UI, graphics and text will simply be larger on high-DPI displays, which for the most part will look the same as they would on lower DPI displays. Older frameworks will either resizing icons and bitmaps, or simply leave them the same size, making them appear smaller. In a lot of apps, this can cause funny anomalies in compact user interfaces, where text labels and other elements might slightly overlap other UI elements in the same window because the developer never anticipated a system font size larger than the typical dimensions found on 96 DPI desktops. Icon’s and bitmaps may look blurry because they weren’t designed to be scaled to these levels.

Un-checking this option will turn on full scaling of all non-DPI aware applications which acts as a compatability mode for non resolution independent apps. The effect is similar to resizing an image in a photo editing program or the scaling of textures in 3D games – fonts will be slightly blurry due to scaling effects of the composer. At really high DPI settings, fonts will become unreadable. The composer is literally resizing the application UI by rendering it’s interface to a off-screen surface and then resizing that surface before sending it to the screen.

A lot of 3rd party apps aren’t high DPI aware, so you’ll get this blurring effect in these apps with the checkbox unselected. You’re only going to see this on desktops where the user has a large cinema display and they’ve adjusted their DPI to a custom level. At 96 DPI on a typical monitor, either setting will look the same. In my case though, I’ve scaled to a custom level – 108 DPI which just happens to be where I like it. I can fit more on my desktop and better leverage my display without having to squint at the screen. It’s a very personal setting which has a lot to do with how good your eye sight is and how far away from your monitor you sit.

By default “XP Style” scaling is enabled for any display setting up to 120 DPI. Beyond that, Vista will default to “Vista Style” scaling. Overall – Win Forms developers are going to need to start paying attention to high DPI UI issues to better handle large screens, myself included. (Windows Presentation foundation apps are resolution independent, so WPF developers have nothing to worry about.) Daisy for example, which is a Win Forms application was not DPI aware. The first time I launched it on Vista with XP style scaling, I had a couple of properties dialogs that had some overlap in the UI. With Vista style scaling the blurrier UI text was annoying.

User’s in general should stick with “XP Style” scaling. If you come across an application that isn’t well designed for larger DPI’s make sure and let the developer know. Even if they don’t have a high resolution monitor, Vista will allow them to scale up the DPI settings to test for anomalies.

Side note – old school MFC hackers need to use a dependency manifest when marking their apps as DPI aware. Calling SetProcessDPIAware in init instance is too late – the MFC library will have already collected up a bunch of system metrics information by then.

Update - Rob Relyea adds in the comments that WPF developers have a few issues to deal with when using raster based graphics in their WPF apps.

Posted by Jim Mathies on June 14th, 2007 | Filed in Technology | 9 Comments »


9 Responses to ““XP Style DPI Scaling””

  1. June 15th, 2007 at 4:48 am

    Rob Relyea said:

    I posted a link to this writeup along with a few other links to MSDN and a few useful blog posts. Thanks for sharing your experience here.
    http://rrelyea.spaces.live.com/blog/cns!167AD7A5AB58D5FE!2090.entry

    Thanks, Rob

    Rob Relyea | Program Manager, WPF & Xaml Language Team
    robrelyea.com | /blog | /wpf | /xaml

  2. July 8th, 2007 at 3:08 pm

    McSeem said:

    Hi Jim,
    The situation with poor scaling in Windows concerns me too, so, I tried to summarize my experience and observations about text rendering and free scaling in the article:
    http://antigrain.com/research/font_rasterization/index.html
    I admit some statements may sound questionable, though. I also might be not so interesting to you, so, please feel free to moderate it.

    McSeem

  3. July 17th, 2008 at 3:32 am

    Edward Griffin said:

    So for non-DPI scaling aware programs, it’s a choice between a broken UI with XP style scaling, or blurred fonts with Vista style scaling. If only there was a third option just to disable scaling for these particular programs. One program I’m talking about is Vodafone Mobile Connect Lite that comes with usb mobile broadband modems. Vista style scaling is the best option for this program, but there is the strange problem that the menu bar is no longer clickable.

  4. January 22nd, 2009 at 6:53 am

    Ed Jolanski said:

    DPI is NOT a “very personal setting” and has absolutely nothing to do with “how good your eye sight is and how far away from your monitor you sit.” DPI is a PHYSICAL CHARACTERISTIC of a monitor. It should NEVER be changed by an end-user, unless for some reason it is not auto-detected properly. The idiots at Microsoft screwed up again by defaulting to 96 DPI for all these years, and all of the idiot Windows developers that don’t know how to code properly gave us crappy apps that do not scale well to high-res displays.

    DPI should only ever affect how crisp and clear the display is, NOT how large the fonts are. You should never have to squint with a high-res display, you mearly have more room to work with. Ideally, users should not even be allowed to change the DPI setting at all. Developers need to be able to rely on having an accurate DPI setting reported by the OS for a particular display.

    The correct solution if you can’t read the screen, is to set your fonts larger. It would be nice if Windows had a single “UI scale” setting, independent of DPI, which would allow you to increase all font and UI sizes uniformly at the same time, instead of having to change each one individually. This is the solution.

    I hope Windows 7 will finally use the DPI values reported by the monitor by default.

  5. May 12th, 2009 at 3:22 am

    Carit said:

    Just installed Adobe Reader 9.1 for Vista(!), which definately does not incorporate this setting. I find it hard to believe that Adobe differentiates the Vista and XP builds. Most likely the binaries are identical :(

  6. August 10th, 2009 at 10:13 am

    Cangaseira said:

    Very nice article,thanks

  7. March 25th, 2010 at 9:41 pm

    Ed said:

    Forget Adobe…Microsoft doesn’t even have all of IT’S applications DPI aware.

    Change the DPI settings higher than the default and then try to view some of the tabs in the options dialog for Windows Media Player 10…text and controls are not visible (shifted off the visible form), etc.

    The problem isn’t limited to Microsoft though…I connected a friend’s Mac Mini to my TV last year…the resolution was fine for watching videos, etc. but I couldn’t find a way to globally increase the font size…you had to do it for each individual application and the setting wasn’t always saved.

    …and don’t EVEN get me started on why very few monitors are made without a high-gloss, highly reflective screen.

  8. May 12th, 2010 at 3:59 am

    tinggi badan said:

    At really high DPI settings, fonts will become unreadable. The composer is literally resizing the application UI by rendering it’s interface to a off-screen surface and then resizing that surface before sending it to the screen.

  9. July 3rd, 2011 at 9:15 am

    What is the downside to Windows XP style DPI scaling in Windows 7 Drija said:

    [...] Dylan B. This answers your question rather well. In short, XP mode scales up the font and UI object sizes as if [...]



Please leave a Comment