[UWP]如何为UWP Panel实现NineGrid背景图像 [英] [UWP]How to achieve a NineGrid background image for UWP Panel

查看:118
本文介绍了[UWP]如何为UWP Panel实现NineGrid背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我发现一个解决方案是直接在$ b内使用< Image> $ b <网格>


将背景图片添加到方式>面板是

 < Grid.Background> 
< ImageBrush ImageSource =" /Assets/Background.jpg"
Stretch =" UniformToFill" />
< /Grid.Background>

但是我还没有找到如何制作 ImageBrush 利用
NineGrid


第一种方法是正确的方法吗?

解决方案

你好  LiuShiAM,


我已经回复了你的主题  此处 ,    图片  控制
有 
NineGrid  属性,
但是 
ImageBrush  没有.T 他最简单的方法是


将Image控件放在底层作为第一种方法。

<网格x:名称=" LayoutRoot"> 
< Image Source =" Assets / image.jpg" Stretch =" UniformToFill" NineGrid =" 50" />
<! - 将你的xaml控件放在这里 - >
< / Grid>

祝你好运,


微风


One solution I found is to use an <Image> directly inside a <Grid>.

Another way to add background image to Panel is

<Grid.Background>
        <ImageBrush ImageSource="/Assets/Background.jpg"
                    Stretch="UniformToFill" />
</Grid.Background>

However I haven't found how to make the ImageBrush utilize NineGrid.

Is the first method the right way to go?

解决方案

Hello LiuShiAM,

I have replied your thread hereThe Image control has a NineGrid property, but the ImageBrush doesn't. The simplest way is

putting the Image control on the bottom layer as your first method.

<Grid x:Name="LayoutRoot">
    <Image Source="Assets/image.jpg" Stretch="UniformToFill" NineGrid="50"/>
    <!--Put your xaml control here-->
</Grid>

Best regards,

Breeze


这篇关于[UWP]如何为UWP Panel实现NineGrid背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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