极品分享

WPF窗口的背景图

方法一:
xaml中:
<控件>  
<控件.Background>
<ImageBrush ImageSource="/WpfApplication1;component/Images/xxx.jpg"/>
</控件.Background>
</控件>  

方法二:
xxxx.cs中:
ImageBrush b3 = new ImageBrush();
b3.ImageSource = new BitmapImage(new Uri(path, UriKind.RelativeOrAbsolute));
this.Background = b3;
2013-04-06 0 /
NET学习
/
标签: 

评论回复

回到顶部