That MemoryStream would include the Bitmap file header, you'll need to manually truncate the first 14 bytes.Sven Groot said:Best I can think of is to save the bitmap (using the Save method) to a MemoryStream, then read out the MemoryStream into a byte array.
EDIT: So, basically:
System.Drawing.Bitmap bmp = GetTheBitmap(); System.IO.MemoryStream stream = new System.IO.MemoryStream(); bmp.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp); stream.Position = 0; byte[] data = new byte[stream.Length]; stream.Read(data, 0, stream.Length);