问题描述
我已经开发了,看起来我的电脑上伟大的,但是当我与不同分辨率和DPI设置其他计算机上安装它,它看起来很可怕的应用程序。控制重叠海誓山盟,它只是苦不堪言。有没有人对如何避免这种情况有什么建议?
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?
推荐答案
有没有办法让Windows知道本地DPI每英寸(点)屏幕,因为没有身体没有办法,屏幕可以告诉它的计算机。这意味着,很多人都会有DPI设置,是不一样的显示器原生DPI。
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.
所以 - 请问这是怎么装进整个WPF二手的DIP(设备独立像素) - 辩论呢?那么,对于WPF来计算多大做出DIP,它需要1信息和1不变:它需要知道你正在运行的分辨率(不是问题),它需要你来你的屏幕设置到其本机DPI。如果你的屏幕是没有设置为本地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=htmlhttp://blogs.microsoft.co.il/blogs/tomershamam/archive/2007/11/30/wpf-is-dpi-depended.aspxhttp://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 :)
这篇关于WPF DPI问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!