缩放WPF窗口 [英] Scaling the WPF window

查看:140
本文介绍了缩放WPF窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

kinect,主窗口的坐标从其中心(视图区域)开始.
我想将此窗口缩放为指定的大小,例如640 * 480.
我为此使用C#.
需要有关此plzz帮助的帮助.
提前谢谢您.

注意:我不想为此使用任何库.

In kinect the co ordinates of the main window starts from the centre(view area) of it.
I want to scale this window to the specified size like 640*480.
I am using C# for this.
need your help regarding this plzz help.
Thank you in advance.

Note : I don''t want to use any libraries for this.

推荐答案

MinWidth,Width和MaxWidth用于管理窗口可以宽度的范围在其生命周期内具有以下配置.

MinWidth , Width, and MaxWidth are used to manage the range of widths that a window can have during its lifetime, and are configured as follows.

<window>
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    MinWidth="300" Width="400" MaxWidth="500"></window>



窗口高度由MinHeight,Height和MaxHeight管理,并配置如下.



Window height is managed by MinHeight, Height, and MaxHeight, and are configured as follows.

<window>
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    MinHeight="300" Height="400" MaxHeight="500"></window>


以下代码显示了一个窗口,该窗口在垂直和水平方向上都会自动调整大小以适应其内容


The following code shows a window that automatically sizes to fit its content, both vertically and horizontally

<window>
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    SizeToContent="WidthAndHeight">
</window>



在您的示例中,您将设置以下内容.



In your example you would set the following.

<window>
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   MinHeight="640"  MinWidth="480"></window>


这篇关于缩放WPF窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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