wpf如何将图片设置为窗体的背景

            System.Drawing.Bitmap bitmap = global::WpfApplication1.Properties.Resources.bg;
            ImageSourceConverter convert = new ImageSourceConverter();
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
            ImageBrush b = new ImageBrush();
            b.ImageSource = (ImageSource)convert.ConvertFrom(ms);
            this.Background = b;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2022-01-09
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
猜你喜欢
  • 2022-12-23
  • 2022-02-02
  • 2022-01-22
  • 2021-10-21
  • 2021-12-16
  • 2021-12-19
相关资源
相似解决方案