在WPF如何与分辨率无关的工作?分辨率、工作、WPF

2023-09-03 04:01:45 作者:少了我地球都要抖三抖

这是更多的是出于好奇。我正在研究的WPF应用程序是独立的分辨率。这是否意味着,我们不必理会显示器分辨率的大小?因为作为一个Windows应用程序开发人员,我所面临使得应用程序兼容不同分辨率的一些挑战。

This is more out of curiosity. I was studying that WPF applications are resolution independent. Does this means that we need not bother about the monitor resolution size? because being a windows application developer I have faced several challenges making the application compatible to different resolutions.

在这里我的问题是WPF如何管理解决自主产权?我们是否需要提供比其控制将出现?而如何将图像的质量也会在作为背景(将其歪曲高分辨率或维持其清晰度)?

My question here is how WPF manages the resolution independent property? Do we need to provide ratios in which controls would appear? And how would the quality of the image will be effected if used as background (will it distort in high resolutions or maintain its clarity)?

请帮忙。这可以是一个项目的决定因素。

Please help. This can be a deciding factor for a project.

推荐答案

据我所知,WPF使用矢量图形的按钮isntead位图像上了年纪的WinForms。由于这个原因,resizizing和适应不同的屏幕分辨率是容易为WPF。 我有背景图像等没有直接的经验,但如果是基于像素的比需要的96 DPI,可能高一倍我会为他们提供了更高的分辨率?这应该保证,他们不会找穷人更高的分辨率。

As far as I know, WPF uses vector graphics for Buttons isntead of Bitmaps like the older WinForms. Due to this, resizizing and adapting to different screen resolutions is easy for WPF. I have no direct experience with Background images etc. but if they are pixel-based I would provide them in a higher resolution than needed in 96 DPI, maybe twice as high? That should guarantee, that they are not looking poor in higher resolutions.

在实际操作注意事项:WPF应用程序始终是可读的,正在寻找好的对我已经试过到目前为止,所有的监视器。但是如果你使用小得多的分辨率来显示这是你能遇到的问题与固定物体更大决议制定了一项计划。例如。定义文本框到一定的最小尺寸,这比吃太多可用的屏幕。因此,似乎最适合我的定义尽可能少的限制,尽可能您运送产品,只是因为它永远是可读之前在其它显示器测试应用程序,但你可能会发现一些问题,usabillity。

As a practical note: WPF applications are always readable and are looking good on all monitors I have tried so far. But if you use far smaller resolutions to display a program which was developed for bigger resolutions you can run into problems with fixed objects. E.g. defining text boxes to a certain minimal size, which than eats too much of the available screen. So it seems best for me to define as few constraints as possible and test the applications on other monitors before you ship the product simply because it will always be readable but you might find a few problems with usabillity.