Re: BMP
- From: John Tsiombikas <nuclear@xxxxxxxxxxxx>
- Date: Fri, 29 Aug 2008 06:12:24 +0000 (UTC)
On 2008-08-29, vicky <vikrant.pandey@xxxxxxxxx> wrote:
I've a code in which the structure of Bitmap is given as ----
typedef struct
{
U8 uFlags; // combination of flags above
U8 uBitsPix; // 1, 2, 4, 8, 16, or 24
U16 wWidth; // in pixels
U16 wHeight; // in pixels
U16 dTransColor; // transparent color for > 8bpp
bitmaps
U8 *pStart; // bitmap data pointer
}GfxBitmap;
an example for this structure is...
GfxBitmap gbHighlightOptionBitmap = { 0x11, 8, 250, 38, 0x00000000,
(UCHAR *) ucHighlightOptionBitmap };
now my query is that if this is a complete header for bmp file then
what about the header for window which is above 50 bytes
That's definitely not a bmp header. That's apparently just a structure
used by the author of the code you were given, used to hold information
about a bitmap after it's loaded.
Going through some *really* old code of mine that used to load 8bpp bmp
files under dos once upon a time, it seems that the bitmap header is
more like the following:
sz | content
2 | identifier (BM)
4 | filesize
4 | reserved/unknown
4 | data offset (offset to the first scanline probably)
4 | header size
4 | image width
4 | image height
8 | ?
4 | data size
.... then there's like 16 more bytes before the palette which is probably
optional.
So anyway the above was just to get an idea, if you need to write a bmp
loader there are probably a lot of references for the file format
around. However I'd suggest you reconsider. If you need a simple
uncompressed 24bit fileformat, take a look at ppm (portable pixmap).
--
John Tsiombikas (Nuclear / Mindlapse)
http://nuclear.sdf-eu.org/
.
- Follow-Ups:
- Re: BMP
- From: vicky
- Re: BMP
- References:
- BMP
- From: vicky
- BMP
Relevant Pages
|