Silverlight 3:调整屏幕分辨率的技术

发布于 2024-08-21 04:57:23 字数 311 浏览 7 评论 0原文

我的开发者盒子的屏幕分辨率为 1680 x 1050。我正在开发一个全屏 Silverlight 3 应用程序,并考虑将其部署到 Internet。因此,我想确保应用程序在各种屏幕分辨率下看起来都不错。我刚刚开始在其他盒子上进行测试,第一个盒子的屏幕分辨率为 1024 x 768。在测试过程中,我发现应用程序上的一些页面被部分截断。页面上的控件似乎没有针对较低的屏幕分辨率进行调整。因此,我正在寻找一些有关如何制作 Silverlight 应用程序的提示,尽可能调整屏幕分辨率。例如,为了更轻松地适应屏幕分辨率,在 XAML 上是否应该执行或不执行某些操作?我应该优化最低屏幕分辨率吗?欢迎您的想法和建议。

My developer's box has a screen resolution of 1680 x 1050. I'm developing a full-screen Silverlight 3 application that I'm considering deploying to the Internet. So, I want to make sure the application looks good on a variety of screen resolutions. I just started testing on other boxes, the first one having a screen resolution of 1024 x 768. During the test I found some of the pages on the application were partially truncated. It seems the controls on the page didn't adjust for the lower screen resolution. So, I'm looking for some tips on how to make a Silverlight application, to the extent possible, adjust for screen resolution. For example, are there things one should or should not do on XAML to make adapting to screen resolution easier? Should I just optimize for a minimum screen resolution? Your thoughts and suggestions are welcomed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

青朷 2024-08-28 04:57:23
  • 您可以通过设置根视觉对象的 MinHeightMinWidth 属性轻松强制执行可接受的最低分辨率。 (当然,这应该小于考虑浏览器镶边的最小屏幕分辨率。)
  • 仅在必要时尝试指定绝对 WidthHeight:例如,对于图像或固定尺寸的图标,或用于明显的情况,例如 TextBoxes(其宽度应反映输入数据的平均长度)。
  • 网格面板非常适合混合可缩放和固定布局区域。星形尺寸规范需要一些时间来适应 - 它不像基于百分比的比例那么简单 - 但它更加灵活,特别是与行/列最小/最大尺寸结合使用。
  • 您实际上并不需要在多种分辨率上进行测试,除非您有兴趣测试每英寸的一系列点数 - 只需调整浏览器的大小以适应不同的屏幕即可。由于根据用户的浏览器配置总会有一些让步,因此无论如何您都必须考虑一些差异。
  • You can easily enforce a minimum acceptable resolution by setting the MinHeight and MinWidth properties of your root visual. (Of course, this should be less than the minimum screen resolution to account for browser chrome.)
  • Try to specify absolute Width and Height only when necessary: for example, for images or icons of fixed dimensions, or for obvious cases like TextBoxes (whose width should reflect the average length of the data entered).
  • Grid panels are excellent for mixing scalable and fixed layout areas. The star sizing specification takes a bit of getting used to--it's not as simple as a percentage-based proportioning--but it's much more flexible, especially in combination with row/column min/max dimensions.
  • You don't really need to test on multiple resolutions unless you're interested in testing a range of dots per inch--just resize the browser to approximate different screens. Since there's always a bit of give and take depending on the user's browser configuration, you'll have to account for some variance anyway.
溺深海 2024-08-28 04:57:23

您可以使用 Silverlight Toolkit ViewBox 来扩展应用程序,或者使用 Grid、StackPanel 和 WrapPanel 等布局控件来扩展应用程序。使您的主 UserControl 的宽度和高度为 Auto(或完全删除宽度和高度),应用程序的大小将调整为父 div 的大小(默认 HTML 模板使用 100%x100%)。然后只需相应地调整浏览器的大小即可。 IE8 具有开发人员工具,可以帮助您查看将应用程序调整为特定屏幕分辨率的大小。

在各种屏幕分辨率上进行测试始终是一个好主意。

You can make your application scale with the Silverlight Toolkit ViewBox or make it strech with layout controls like the Grid, StackPanel, and WrapPanel. Make your main UserControl have a Width and Height of Auto (or remove the width and height entirely) and the size of the app will resize to the size of the parent div (the default HTML template uses 100%x100%). Then just resize the browser accordingly. IE8 has developer tools that can help you see your app resized to specific screen resolutions.

Testing on a variety of screen resolutions is always a good idea.

望她远 2024-08-28 04:57:23

我介绍了元素大小的调整以及使其分辨率独立于另一个线程。

您可以查看这里,有多种方法可以调整大小和调整大小自动地。

I covered the resizing of elements and making it resolution independent on another thread.

You can have a look here, there are multiple ways to sizing and resizing things automatically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文