当我打开应用程序时,我的背景拉伸发生变化

问题描述 投票:0回答:1

当我打开应用程序时,我的背景图像发生变化

我使用过:

<Grid Name ="alo">
        <Grid.Background>
            <ImageBrush ImageSource="D:\Smth\Pics\135.jpg" Stretch="None"/>
        </Grid.Background> 

background before launch

background afterlaunch

c# wpf xaml grid stretch
1个回答
0
投票
为了使其在填充网格的同时保持其纵横比,将Stretch设置为UniformToFill:

<ImageBrush ImageSource="D:\Smth\Pics\135.jpg" Stretch="UniformToFill"/>

© www.soinside.com 2019 - 2024. All rights reserved.