WPF背景图


方法一:
xaml中:
<控件>  
<控件.Background>
<ImageBrush ImageSource="/程序集;component/images/xxx.jpg"/>
</控件.Background>
</控件>  

方法二:
xx.cs中:
ImageBrush ib = new ImageBrush();
ib.ImageSource = new BitmapImage(new Uri(图片路径, UriKind.RelativeOrAbsolute));
控件名.Background = ib;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM