Re: Reading .BMPs the hard way
Re: Reading .BMPs the hard way
- Subject: Re: Reading .BMPs the hard way
- From: Alexander Griekspoor <email@hidden>
- Date: Fri, 18 Mar 2005 11:04:58 +0100
Thanks Matt! Indeed that works, sort of...
I suspect that the struct is being padded after bfType and you end up with one whose sizeof is not 14. My guess is that sizeof(WINBITMAPFILEHEADER) is returning 16 in your case.
Yep, it was indeed.
try wrapping its definition with
<x-tad-smaller>#pragma options align=mac68k</x-tad-smaller><x-tad-smaller>
</x-tad-smaller>
typedef struct tagWINBITMAPFILEHEADER
{
short bfType;
int bfSize;
short bfReserved1;
short bfReserved2;
int bfOffBits;
} WINBITMAPFILEHEADER;
<x-tad-smaller>
</x-tad-smaller><x-tad-smaller>#pragma options align=reset</x-tad-smaller><x-tad-smaller>
</x-tad-smaller>
Now it is 14 indeed. The two reserved values are correctly 0 now. However, while the docs state that bfType should return 19778 or 'BM', I get the number 16973. Also the values I get for bfSize and bfOffbits seems odd (larger than the total filesize!?).
Alex
*********************************************************
** Alexander Griekspoor **
*********************************************************
The Netherlands Cancer Institute
Department of Tumorbiology (H4)
Plesmanlaan 121, 1066 CX, Amsterdam
Tel: + 31 20 - 512 2023
Fax: + 31 20 - 512 2029
AIM: email@hidden
E-mail: email@hidden
Web: http://www.mekentosj.com
4Peaks - For Peaks, Four Peaks.
2004 Winner of the Apple Design Awards
Best Mac OS X Student Product
http://www.mekentosj.com/4peaks
*********************************************************
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden