The bitmap-format 
Author Message
 The bitmap-format

Anyone knows why the UNIX bitmap-format is as it is?
I know this has not much to do with tcl/tk, but since I was using
the -bitmap feature in tk when I discovered the strange format, I got a
little curious.

I would have thought that to make a bitmap you would start at the upper left corner, taking 4 pixels at a time to make a hexadecimal number. Then you group two hexadecimal numbers together. So a picture looking like

        0111 0101 1101 1110 ....

(spacing just for convinience)
would be 0x75, 0xde, ....

But instead, the format switch the two hexadecimal number, so that 0x75 becomes
0x57 and then reverses the bits in each number to get a new number.

So the first two number in the example, 0111 0101, will exchange places to
give 0101 0111 and then we reverse the order of the bits in each of them,
to end up with 1010 1110. This gives us 0xae, and not 0x75 as we started with (which I thought was more logical...)

Anyone knows why?

Cheers,
        Jostein



Sat, 30 Sep 1995 14:55:35 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Converting Windows Bitmap to X bitmap format so that Tk can display it

2. How to Convert X Bitmap Format to Windows Bitmap Format?

3. Problem in Bitmap format

4. Problem in Bitmap format

5. where can I find a description of bitmap format?

6. Bitmap header format + PTR operator

7. Bitmap header format

8. Bitmap for icon != bitmap for button?

9. coloured bitmap with the option -bitmap ?

10. routine to convert date format 0CYYDDDF to format DD/MM/YY or DDMMYY

11. Format of a TSO XMIT format dataset

 

 
Powered by phpBB® Forum Software