views:

35

answers:

1

I've noticed that some applications (eg. Visual Studio 2008, Gallio Icarus 3.1) don't look that great (eg. fonts are blurry) when I run them on my laptop which has fonts set to 120%, whereas other applications seem to render fonts crisply.

I have unchecked the 'Enable Windows XP style scaling' option in the 'Custom DPI Setting' dialog in the Control Panel.

I understand that it makes sense for WPF-based apps like VS2010 to look great, but wonder what particular API or configuration settings should be made such that regular GDI-based apps (eg. WinForms) can also display nicely.

+2  A: 

That sounds a lot like DPI Virtualization at work. It normally kicks in beyond 120 DPI but you probably got it from turning off XP scaling. Unless a program has the DPIAware element in its manifest, Vista/Win7 will get the program to render its output into a memory buffer and draw that buffer rescaled to match the selected DPI. The rescaling makes the font edges look fuzzy since the anti-aliasing pixels no longer fit the LCD pixel grid.

Most programs require this because they are simply DPI un-aware, programmed to count on the video adapter set to 96 DPI. You'll get trouble like text that no longer fits the control, images that are too small and unsizable windows the size of a postage stamp. Vista is the first version of Windows that tries to do something about this age-old problem, hopefully opening the door to high-resolution LCD panels. Getting to 300 DPI isn't going to happen otherwise, it is high time. Especially for WPF.

Ask more questions about this at superuser.com

Hans Passant
I appreciate there is an end-user side to this question where SuperUser would be appropriate, but I was specifically interested in the Windows API/configuration-level settings that would affect how the application was rendered. Thanks for the detailed answer.
David Gardiner
Thanks Hans - your answer pointed me in the direction of http://msdn.microsoft.com/en-us/library/dd464646.aspx which seems to detail what to do for managed and unmanaged applications.
David Gardiner