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."
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…