If the goal is to get only the pixel data of the bitmap, I'd probably use LockBits. I'm not sure if I knew about that 4 years ago.W3bbo said:That MemoryStream would include the Bitmap file header, you'll need to manually truncate the first 14 bytes.Sven Groot said:*snip*
And if I were to write the example above today, I'd replace the last two lines with MemoryStream.ToArray, and put the MemoryStream in a using block (it's not really necessary with MemoryStream but it's a good habit to do it with anything disposable anyway).