【发布时间】:2013-08-14 16:47:08
【问题描述】:
Visual Studio 2012,WPF C# Windows 应用程序。 XAML:
<Window x:Class="Edge.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid Background="Blue">
<Image Source="Images/House.png"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Stretch="Fill" Margin="3"
/>
</Grid>
</Window>
图像没有像我想要的那样拉伸到整个窗口,它只显示在 1/4 窗口区域。我希望Stretch="Fill" 必须将图像拉伸到整个窗口。怎么了?
【问题讨论】:
-
@Clemens - 这是我的 XAML 页面的精确副本,应用程序不包含除此代码之外的任何内容。
-
已解决 - 图片显示正常,有白色区域,需要剪掉。
-
我相信您的图像中有白色。我已经在我的机器上测试了你的代码,它工作正常。我机器中的图像压力很大。