Archived

This topic is now archived and is closed to further replies.

whats Offset?????

This topic is 5590 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m currently reading about the bitmap format and it mentions Offset and some numbers that look something like this: 0000h 0002h 0006h 000Ah and many similar I was wondering if anyone could explain what they meant???? are they byte positions in a file or something????? ( just a wild guess ) could some one plz help me out here? cheers Stealth

Share this post


Link to post
Share on other sites
The values are supposed to be hexadecimal values.
The decimal equivalents are

0000h = 0
0002h = 2
0006h = 6
000Ah = 10

In hex digits can hold the values: 0 to 9 and A (decimal 10) to F (decimal 15).
So every digits can have 16 different states -> representing 4 bits of data (half byte).
So the above 4-digits-values are 2 Bytes long.

I don't know that context, but concerning graphics one could use 16 bit values to represent pixel color values in 16 bit color depth.



[edited by - perkele on August 27, 2002 8:29:26 AM]

Share this post


Link to post
Share on other sites
If you are talking about Windows bitmap format, there is one value that is the offset to the sdata from the start of the file.

---
Make it work.
Make it fast.

"I’m happy to share what I can, because I’m in it for the love of programming. The Ferraris are just gravy, honest!" --John Carmack: Forward to Graphics Programming Black Book

Share this post


Link to post
Share on other sites
quote:
Original post by perkele
So every digits can have 16 different states -> representing 8 bits of data (half byte).

That should be every hex-digit (a.k.a. nibble) can have 16 different states -> representing 4 bits of data (half byte).

Share this post


Link to post
Share on other sites
quote:

are they byte positions in a file or something?????



From the context I''d say that they are indeed byte positions in the file. What the others said about hex will show how to interpret the actual numbers, but they do represent positions from the start of the file:


Offset(hex) Offset(decimal) Length in bytes
0000h 0 2
0002h 2 4
0006h 6 4
000Ah 10 ?


Share this post


Link to post
Share on other sites
ok thanks alot guys , but I was wondering , because I''m reading from a Bitmap file , if I KNEW the hex value of where the "pixel data" started would I be able to skip straight to it by ignoring all the bytes before it and then read the data in to load the bitmap?????

Share this post


Link to post
Share on other sites