uwp开发————换背景图片
用后台代码来实现对容器背景的切换,用本地图片作为背景。把需要的图片素材放到Assets文件夹下前台xaml代码如下:就是起了个名字。。。后台c#代码ImageBrush imageBrush = new ImageBrush();imageBrush.ImageSource = new BitmapImage(new Uri("ms-appx:///
·
用后台代码来实现对容器背景的切换,用本地图片作为背景。
把需要的图片素材放到Assets文件夹下
前台xaml代码如下:
<Grid x:Name="gd_backimage">
</Grid>
就是起了个名字。。。
后台c#代码
ImageBrush imageBrush = new ImageBrush();
imageBrush.ImageSource = new BitmapImage(new Uri("ms-appx:///Assets/sunny.jpg", UriKind.Absolute));
gd_backimage.Background = imageBrush;
Ok。
更多推荐
已为社区贡献1条内容
所有评论(0)