|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hi!
Here is a question i started to think about when i recently started my latest project. I have not got any answer to my question yet, so i hope that someone here might help me. Declarations such as WORD, DWORD, UINT and LONG are as far as i know platform dependant. That is, the number of memory bytes they allocate can differ from computer to computer platform. Now, according to the specification of a bitmap file the BITMAPFILEHEADER consist of : UINT bfTYPE; DWORD bfSize and some other variables. As the bitmap file consist of variables that are platform dependant this should then mean that the size of the bitmap file can vary between different platforms. But as far as i know bitmap files are platform independant!!! How is this? //Paul |
| Sponsored Links |
|
|
|
|||
|
Hi!
As you say, "UINT" is the same as "unsigned int" and according to the C standard a "int" or "unsigned int" is defined as "at least 16 bits". This means that an int can actually be more than 16 bits on some architectures. So if you have two computers with different architecture (one that defines a UINT as 16 bits, and the other that defines a UINT as 32 bits) and creates a bitmap file on one computer. Then it will be corrupt if you try to read it on the other computer, would it not? |
|
|||||
|
Quote:
About your next question; I'm not sure. I would (after I thought about it) say it would be corrupted, but I can't say for sure, I've never tried to open a 32-bit bitmap file on a 16-bit processor. There's probably some other people around here who can help you further, with a more detailed explanation. |
|
|||||
|
I think he has used a specification page like those you can find on MSDN, such as this one.
|
|
|||
|
Yes, the info is taken from a Microsoft Windows spec of Bitmap file format. But is is also the only spec i found when googlling on bitmap.
The question is the same between 32- and 64-bit computers as between 16- and 32-bit machines. Does anyone know? |
|
|||||
|
Another question: would the endian-ness of the OS affect reading the file?
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ionFiles Popular Files Module | Jordan | ionFiles | 1 | 07-03-2008 03:13 PM |
| Alter many files, all with same variable in them | woocha | PHP Forum | 3 | 01-17-2008 07:06 PM |
| How do I read .mbm (Multi BitMap) files? | moondog | General Programming | 7 | 08-07-2007 08:08 AM |
| Java Help Files | xXHalfSliceXx | Java Help | 3 | 11-29-2006 12:30 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%