How to convert Byte[] to BitmapImage
I need help, I have this method to get a BitmapImage from a Byte[] public BitmapSource ByteToBitmapSource(byte[] image) { BitmapImage imageSource = new BitmapImage(); using (MemoryStream stream = new MemoryStream(image)) { stream.Seek(0, SeekOrigin.Begin); imageSource.BeginInit(); imageSource.StreamSource = stream; imageSource.CacheOption = BitmapCacheOption.OnLoad; imageSource.EndInit(); } return imageSource; } imageSource.EndInit(); throws an error "We found no imaging component suitable to complete this operation." Set Image.Source to a byte array property in XAML. <Image x:Name="MyImage"