title: System.OutOfMemoryException when creating brush from image byte array
body: <p>I sometimes need to load an image from a byte array like this:</p>
  
  <pre><code>Bitmap image = null;
  
  using (var ms = new MemoryStream(File.ReadAllBytes(sourceImagePath)))
  {
      image = (Bitmap)Image.FromStream(ms);
  }
  </code></pre>
  
  <p>Now I need to create a <code>TextureBrush</code> from that image, so I use the following approach:</p>
  
  <pre><code>using (var b = new TextureBrush(image))
  {
  
  }
  </code></pre>
  
  <p>It throws <code>System.OutOfMemoryException: 'Out of memory.'</code>. After a while of experimenting, I've found that I can create the brush if I use <code>Image.FromFile</code> like this:</p>
  
  <pre><code>using (var b = new TextureBrush(Image.FromFile(sourceImagePath)))
  {
  
  }
  </code></pre>
  
  <p>For brevity, I will not go into the reason why I do not want to use this method, so can anyone show me how I can use the byte array approach in the first example?</p>