方法一,xaml中:

<控件>   
    <控件.Background>
        <ImageBrush ImageSource="/WpfApplication1;component/Images/xxx.jpg"/>
    </控件.Background>
</控件>      

 

方法二,cs中:

ImageBrush bg = new ImageBrush();
bg.ImageSource = new BitmapImage(new Uri(path, UriKind.RelativeOrAbsolute));
this.Background = bg;

 

相关文章:

  • 2021-05-04
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-09-25
  • 2021-09-05
相关资源
相似解决方案