WPF 调整窗口大小
我维护一个触摸屏应用程序,并将其重写到.Net 中。 多年来,触摸屏的分辨率已大大提高。 不仅分辨率更高,而且像素也更密集,使得查看/操作触摸按钮变得更加困难。
WPF 有没有办法强制应用程序窗口随着分辨率/像素密度的变化而自行缩放? 我不想每隔几年就重新设计这些屏幕。
I maintain a touch screen application that I'm re-writing into .Net. Through the years the resolution of the touch screens has increased greatly. Not only is the resolution higher, but the pixels are also much more dense making it harder to see/operate the touch buttons.
Is there a way with WPF to force application windows to scale themselves larger as resolutions/pixel density changes? I'd rather not have to rework these screens every few years.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就在这里。
您可以使用 WPF 的 ViewBox 包装您的容器。 这是示例:
屏幕截图:
咨询此主题了解更多信息。
Yes, there is.
You can wrap your container with WPF's ViewBox. Here goes the example:
Screenshot:
Consult this topic for more info.
这是默认行为,每个 WPF“像素”是 1/96 英寸,而不是实际像素(现在唯一的问题是,几乎所有屏幕都设置为 96DPI,无论屏幕实际分辨率如何)。
This is the default behavior, each WPF "pixel" is 1/96 of an inch and not an actual pixel (now the only problem is that virtually all screens are set to 96DPI regardless of the screen actual resolution).