在WPF中调整Windows大小的图像 [英] Image resize on windows resize in WPF

查看:64
本文介绍了在WPF中调整Windows大小的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们.我是WPF的新手,只是从Grid开始.
在我的windows.xmal中,我为Grid设置了背景图像.当此窗口的默认大小合适时...但是更改或调整大小的Windows图像时,请从其中任意一个剪切大小..请帮帮我.
对我的拼写错误sakry

Hi friends . I am new in WPF n just start with Grid .
in my windows.xmal i have set backgroung image for Grid. it fine when this window is in its default size...but upon changing or resizing Windows image get cut from it either size.. please help me out.
srry for my spelling mistak

推荐答案

删除图像宽度,高度或对齐方式的任何属性.那应该照顾好它.
Remove any attributes regardng the images width, height, or alignment. That should take care of it.


希望这对您有用...
Hope this works for you...
<Grid >
       <Grid.Background>
           <ImageBrush ImageSource=""></ImageBrush>
       </Grid.Background>
   </Grid>


这篇关于在WPF中调整Windows大小的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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