Как я могу получить ImageSource
из MemoryStream
в WPF с помощью С#? или преобразовать MemoryStream
в ImageSource
, чтобы отобразить его как изображение в wpf?
Получение изображений из Memorystream в С# wpf
Ответ 1
using (MemoryStream memoryStream = ...)
{
var imageSource = new BitmapImage();
imageSource.BeginInit();
imageSource.StreamSource = memoryStream;
imageSource.EndInit();
// Assign the Source property of your image
image.Source = imageSource;
}