title: Convert Bitmap into Color[]
body: <p>I have a bitmap that I want to convert into a color array, faster than if I had used the GetPixel function.</p>
  
  <p>So far I have seen people convert the bitmap into a byte array first then into the color array:</p>
  
  <pre><code>Bitmap bmBit = (Bitmap)bit;
  
  var bitmapData = bmBit.LockBits(new Rectangle(0, 0, bmBit.Width, bmBit.Height),
          ImageLockMode.ReadWrite, bmBit.PixelFormat);
  var length = bitmapData.Stride * bitmapData.Height;
  byte[] bytes = new byte[length];
  Marshal.Copy(bitmapData.Scan0, bytes, 0, length);
  bmBit.UnlockBits(bitmapData);
  </code></pre>
  
  <p>But this returns a  bmBit with incorrect numbers.
  What am I doing wrong, and is there a better way to do this without converting to a byte array first?</p>