开发者

WPF does not appear to be resolution independent

My understanding is that one of the fundamental concepts in WPF is that it is resolution independent. That if an object takes up a 1" square at one resolution it will also take up an 1" square on a different resolution.

I'm not sure if there are design considerations here, but this appears to be completely false. Whether it be a font, an image or some other visual entity, they 开发者_JS百科are all physically smaller when on a higher resolution.

How can I truly make this resolution independent? It appears that like Windows Forms it uses pixels and as the pixel density changes so does the true size of the graphical entities.


You may be misunderstanding WPF's definition of "independence". This subject is discussed in excellent detail in this MSDN forum thread, and includes input from Microsoft MVP Charles Petzold:

A WPF programs[sic] wants to draw a ruler on the screen. It draws 96 units per inch.

In all these cases, for any particular machine, the ruler is exactly the same size, and it's the same size as the ruler displayed by Microsoft Word. Of course the ruler is going to be different sizes on different machines. Connect the machine to an overhead projector and the inches on the ruler are more like feet!

In short, since the application can't be aware of the physical characteristics of your display device (how is it to know if a single pixel is a square micrometer or a square inch in physical size?), you can't make your application "truly" resolution-independent, not according to your definition.

Tim Dawson, from the linked thread (emphasis mine):

You're not going to somehow "fix" the dilemma of the user playing with the hardware settings so much that your app doesn't look quite right. WPF goes a lot further towards fixing this than anything has before, though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜