了解图形和像素 [英] understanding Graphics and pixels

查看:74
本文介绍了了解图形和像素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您创建一个Form,并将Height属性设置为1000,而Width属性设置为1000.

然后,您使用VS Designer并绘制一个GUI.

我了解,除非更改,否则大小将基于像素.

如果该表格在我的显示器上看起来不错,但随后以更高的分辨率安装在了显示器上,我的表格会看起来更小吗?

如果安装在宽显示器上,并且用户可以最大限度地使用表格,我会想象有很多死角吗?

桌面应用程序设计人员是否对此行为有任何处理?

Suppose you create a Form and set the Height Property to say 1000 and the Width Property to say 1000.

Then you use the VS Designer and draw a GUI.

I understand that, unless changed, sizing is based on Pixels.

If the form looks good on my monitor, but is then installed on a monitor with my higher resolution, will my form look smaller?

If installed on a wide monitor, and the user maximizes the form, i would imagine there is a lot of dead space?

Do Desktop application designers do anything about this behaviour?

推荐答案

我的表单会变小吗?"是的,如果显示器的物理尺寸相同.尝试一下:运行程序,然后更改显示器分辨率.明白我的意思吗?

我会想象会有很多死角?"哦是的!但是有一种解决方法:尝试更改控件的Anchor属性.这样,它们将在您的表单运行时伸展.再说一次:试试看!

桌面应用程序设计人员是否对此行为有任何作用?"在WinForms中,通常没有.设计表单以保存用户所需的信息,而不是更多.太多的信息严重无济于事-如果将其隐藏在许多其他信息中,用户将找不到所需的信息.使用Tab控件等将逻辑信息分组在一起,并在必要时打开新表单.在WPF中,您可以更轻松地扩展内容-但这也不是用户想要的!
"will my form look smaller?" Yes, if the monitors are the same physical size. Try it: run your program, then change your monitor resolution. See what I mean?

"i would imagine there is a lot of dead space?" Oh yes! But there is a way round this: Try changing the Anchor property of your controls. That way they will stretch when your form does. Again: try it!

"Do Desktop application designers do anything about this behaviour?" in WinForms, generally no. Design your form to hold the information the user needs, not more. Too much information is seriously unhelpful - the user can''t find what he needs if it is hidden in a lot of other info. Use Tab controls and so forth to group logical information together, and open new forms when necessary. In WPF you can scale things more easily - but that probably isn''t what the user wants, either!


这篇关于了解图形和像素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆