title: How to convert Byte[] to BitmapImage
body: <p>I need help, I have this method to get a BitmapImage from a Byte[]</p>
  
  <pre><code>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;
  }
  </code></pre>
  
  <p><code>imageSource.EndInit();</code> throws an error "We found no imaging component suitable to complete this operation."</p>