By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,872 Members | 2,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,872 IT Pros & Developers. It's quick & easy.

Extracting BITMAPINFOHEADER from Bitmap object

P: 2
This is my first post to this forum, so HI :)

I have a Bitmap object loaded from a bmp file. I need to pass this object to a function that expects 2 byte[] - one with the image data, other with the header data (BITMAPINFOHEADER structure). I found some code on the net to convert the image data to byte[].

I would like to know how to get the header information from Bitmap object into a byte[]. Please help!
Apr 25 '07 #1
Share this Question
Share on Google+
3 Replies


TRScheel
Expert 100+
P: 638
Sounds like System.IO and stream are what you are looking for. You can read byte from there until the header is done (I dont remember what to look for on bitmaps tbh though, you would have to look up what signifies the end of the header).
Apr 25 '07 #2

P: 2
Thanks for the reply, but I'm not sure if I understand what you mean (I'm new to image processing). I got the Bitmap data to byte[] conversion from here:

http://www.vbforums.com/showthread.php?t=358917

I just assumed that the above will return byte[] with image data.

Could you please take a look at the above (I'm using Method 2 now) and tell me if it has anything to do with your suggestion?
Apr 26 '07 #3

TRScheel
Expert 100+
P: 638
Thanks for the reply, but I'm not sure if I understand what you mean (I'm new to image processing). I got the Bitmap data to byte[] conversion from here:

http://www.vbforums.com/showthread.php?t=358917

I just assumed that the above will return byte[] with image data.

Could you please take a look at the above (I'm using Method 2 now) and tell me if it has anything to do with your suggestion?

Yes, it is exactly what I was talking about.

Here is some specification about the bitmap header (windows specification, mind you... )

Bitmap Header Info

From what it says, you would skip past the first 54 bytes to get to the actual data.
May 10 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.