我从服务器收到了一个 image/jpeg;base64 字符串。我该如何将这个字符串转换成 BitmapImage,并像 Image.Source 一样设置它?
感谢您的提前支持!
string imgStr = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAAQABAAD .... ";
BitmapImage bmp = Base64StringToBitmap(imgStr);
myImage.Source = bmp;
感谢您的提前支持!
byte[] byteBuffer = Convert.FromBase64String(base64String);
获取字节,但不知道如何设置到你的图像控件中。 - Vitor Canova