我知道如何在WinForms中这样做
byte[] binaryData = Convert.FromBase64String(bgImage64); image = Image.FromStream(new MemoryStream(binaryData));
但是我如何在WPF中做同样的事情?
解决方法
byte[] binaryData = Convert.FromBase64String(bgImage64); BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.StreamSource = new MemoryStream(binaryData); bi.EndInit(); Image img = new Image(); img.Source = bi;