title: Show RGBA image from memory
body: <p>I have a C# byte array containing an RGBA encoded image. What is the best way to show this image in WPF?</p>
  
  <p>One option would be to create a BitmapSource form the byte array and attach it to an Image control. However, creating a BitmapSource requires a PixelFormat for RGBA32, which doesn't seem to be available in Windows.</p>
  
  <pre><code>byte[] buffer = new byte[] { 25, 166, 0, 255, 90, 0, 120, 255 };
  BitmapSource.Create(2, 1, 96d, 96d, PixelFormats.Bgra32, null, buffer, 4 * 2);
  </code></pre>
  
  <p>I definitely don't want to swap pixels in my byte array.</p>