Re: BMP
- From: vicky <vikrant.pandey@xxxxxxxxx>
- Date: Fri, 29 Aug 2008 00:07:03 -0700 (PDT)
On Aug 29, 11:12 am, John Tsiombikas <nucl...@xxxxxxxxxxxx> wrote:
On 2008-08-29, vicky <vikrant.pan...@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/- Hide quoted text -
- Show quoted text -
---------------------------------------
Hi,
First of all Thanks Mr. John Tsiombikas
Actually i first concentrate on code.
Should u plz tell me that what the use of structure of the bitmap here
in code.
I also wanna tell U that for a RLE encoding check
here the uFlag is anded by 0x01 in code.
My priority is to know about the bitmap file and its
drawing ...according to coding approach
Actually i read about bmp from net but its change when I watch the
code for bmp draw...
Should U please tell me
Thanks in advance.
VIkrant
.
- Follow-Ups:
- Re: BMP
- From: John Tsiombikas
- Re: BMP
- Prev by Date: Re: BMP
- Next by Date: Weekend DSP + DIP training starting from 6th September
- Previous by thread: Re: BMP
- Next by thread: Re: BMP
- Index(es):
Relevant Pages
|
Loading