Public Group

#### Archived

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

# whats Offset?????

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

## 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 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 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 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 on other sites
thanx & sorry - just a slip of the pen...

##### 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 bytes0000h             0                  20002h             2                  40006h             6                  4000Ah             10                 ?

##### 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 on other sites
actually forget that last question

1. 1
Rutin
25
2. 2
3. 3
4. 4
5. 5

• 10
• 13
• 19
• 14
• 9
• ### Forum Statistics

• Total Topics
632943
• Total Posts
3009348
• ### Who's Online (See full list)

There are no registered users currently online

×