title: "Parameter not valid" exception loading System.Drawing.Image
body: <p>Why am I getting the exception "Parameter not valid" in my code:</p>
  
  <pre><code>MemoryStream ms = new MemoryStream(byteArrayIn);
  System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
  </code></pre>
  
  <p>The length of <code>byteArrayIn</code> is 169014. I am getting this exception despite the fact that no value in it is greater than 255.</p>