tags:

views:

373

answers:

1
+1  Q: 

WPF DPI issues...

I have developed an application that looks great on my computer but when I install it on other computers with different resolutions and DPI settings, it looks terrible. Controls overlap eachother and it's just miserable. Does anyone have any suggestions on how to avoid this?

+1  A: 

There's no way for Windows to know the native DPI (Dots per inches) of your screen, since there's physically no way that the screen can tell it to the computer. This means that a lot of people will have DPI settings, that aren't the same as their monitors native DPI.

So- how does this fit into the whole "WPF used DIPs (Device independent pixels)"-debate? Well, for WPF to calculate how large to make a DIP, it needs 1 information and 1 invariant: It needs to know the resolution you're running (not a problem) and it needs for you to set your screen to its native DPI. If your screen it not set to the native DPI, pixels might be larger or smaller than they should, compared to the physical size of the screen.

It's quite hard to explain really, have a look at these blog posts: http://www.odewit.net/ArticleContent.aspx?id=WpfDpiScaling&lang=en&format=html http://blogs.microsoft.co.il/blogs/tomershamam/archive/2007/11/30/wpf-is-dpi-depended.aspx http://www.wpflearningexperience.com/?p=41 (Down right now :( )

In general, you should make your UI scalable with stuff like scrollbars, paging controls and the likes, to avoid overlaps :)

cwap
Thanks. Yeah the controls that are overlapping cannot really be remedied with paging controls etc. I will definitely look into the articles, though. :)
Joe