我知道如何在 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;
关于c# - 我如何在 WPF 中读取 base64 图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/593388/