Original Post
Hello, I'm trying to write a System.Drawing.Image into a MemoryStream without the header information. I only want to byte array that makes up the pixel data. Does anyone know of a way to do this? Right now I have to save the image into a MemoryStream and then copy that memory stream to a new byte array with a 54 byte offset.
Image t_image = Image.FromFile(ResourceFile);
MemoryStream t_ms = new MemoryStream();
t_image.Save(t_ms, System.Drawing.Imaging.ImageFormat.Bmp);
byte[] t_byte = new byte[t_ms.Length - 54];
t_ms.Position = 54;
t_ms.Read(t_byte, 0, (int)t_ms.Length - 54);
That's how I'm accomplishing it right now. I know that the bmp header is 54 bytes. Thanks, Giawa