是否有任何默认策略来准备决议变更申请?

发布于 2024-10-31 22:31:38 字数 159 浏览 1 评论 0原文

如何准备 Silverlight 或 WPF 应用程序从大分辨率更改为小分辨率?

我想使用停靠面板策略仅适用于从小分辨率更改为大分辨率。

那么,有没有默认的策略呢?谢谢。

问题:我有一个按钮,两端像素为 1024、768。我将分辨率更改为 800x600。

How to prepare a Silverlight or WPF application to change from a big resolution to a small resolution?

I guess using dockpanel strategy only works for changing from a small to a big resolution.

So, is there any default strategy? Thanks.

Problem: I have a button the ends in the pixel 1024, 768. And I change the resolution to 800x600.

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

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

发布评论

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

评论(3

花辞树 2024-11-07 22:31:38

前段时间我也遇到过类似的问题。作为解决方法,我将窗口内容包围在 Viewbox 中。

使用 1024x768 而不是 1280x1024 的用户会看到应用程序内容更小,但他们更喜欢这样而不是一直滚动。 (WPF)

我必须为我们的下一个项目解决这个问题,希望有人有更好的想法!

Some time ago I had a similar issue. As a workaround I surrounded the window content in a Viewbox.

Users that used 1024x768 instead of 1280x1024 see the application content smaller, but they preferred this than scrolling all the time. (WPF)

I'll have to work on this for our next project, let's hope somebody has better ideas!

淑女气质 2024-11-07 22:31:38

好吧,您可以将布局设计为“拉伸”,并在设计时考虑到 800x600,因此只要布局变得大于 800x600,它就会适合。但是...

如果您确实想要一些奇特的东西,请检测窗口大小/ActualHeight 和 ActualWidth 的变化(使用 SizeChanged),然后通过代码根据大小缩放应用程序(使用动态变换)。

例如,在主视图中的“LayoutRoot”中:

var x = new ScaleTransform();
            x.ScaleX = .5; // Do fancy computation here
            x.ScaleY = .5; // Do fancy computation here
            this.LayoutRoot.RenderTransform = x;

只是一个想法,我的意思是如果屏幕比您放大的设计大,反之亦然。

希望这有帮助。

Well, you could design your layout to Stretch and designing it with 800x600 in mind, so whenever the layout becomes larger than 800x600 it will fit. But...

if you really want something fancy, detect the change in the window size/ActualHeight and ActualWidth (using SizeChanged) then scale the the application according to size via code (using dynamic transforms).

For example, in the "LayoutRoot" in your main view:

var x = new ScaleTransform();
            x.ScaleX = .5; // Do fancy computation here
            x.ScaleY = .5; // Do fancy computation here
            this.LayoutRoot.RenderTransform = x;

Just an idea, i mean if the screen is bigger than your design you enlarge and vice versa.

Hope this helps.

断爱 2024-11-07 22:31:38

我认为这样做更好:


ScrollViewer Background="GreenYellow" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" Name="layoutRoot">
        Canvas Width="1024" Height="768">
            dataInput:Label Height="50" Name="label1" Width="100" Canvas.Left="540" Canvas.Top="131" Content="aeeeeeeee" />
            Button Canvas.Left="12" Canvas.Top="131" Content="Button" Height="23" Name="button1" Width="75" />
            Button Canvas.Left="937" Canvas.Top="147" Content="Button" Height="23" Name="button2" Width="75" />
            Button Canvas.Left="510" Canvas.Top="21" Content="Button" Height="23" Name="button3" Width="75" />
            Button Canvas.Left="482" Canvas.Top="550" Content="Button" Height="23" Name="button4" Width="75" />
        /Canvas>
    /ScrollViewer>

I think doing this way is better:


ScrollViewer Background="GreenYellow" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" Name="layoutRoot">
        Canvas Width="1024" Height="768">
            dataInput:Label Height="50" Name="label1" Width="100" Canvas.Left="540" Canvas.Top="131" Content="aeeeeeeee" />
            Button Canvas.Left="12" Canvas.Top="131" Content="Button" Height="23" Name="button1" Width="75" />
            Button Canvas.Left="937" Canvas.Top="147" Content="Button" Height="23" Name="button2" Width="75" />
            Button Canvas.Left="510" Canvas.Top="21" Content="Button" Height="23" Name="button3" Width="75" />
            Button Canvas.Left="482" Canvas.Top="550" Content="Button" Height="23" Name="button4" Width="75" />
        /Canvas>
    /ScrollViewer>

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