Re: BMP



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
.



Relevant Pages

  • Re: BMP pixel array
    ... Is this a .BMP file or a Bitmap data array? ... is it using some kind of compression such as RLE or Bit-fields or is the data uncompressed? ... > files with an Info Header of 40 byte. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Storing/Saving a BMP in ASM
    ... To save a BMP in any language, assuming you have access to the pixel's ... values on screen (you can read the bitmap from screen), ... Info on how to store the lines and what the header should ...
    (comp.lang.asm.x86)
  • Re: copy image to windows clipboard?
    ... Your assumption about lacks in the Img BMP parser are correct. ... I've implemented the missing 16 and 32 bit format parser ... the offset to the bitmap was the offset to the bitmap header. ...
    (comp.lang.tcl)
  • Re: BMP
    ... now my query is that if this is a complete header for bmp file then ... That's definitely not a bmp header. ... about a bitmap after it's loaded. ... | data offset ...
    (comp.graphics.algorithms)
  • Re: bitmap
    ... > bytes(the bitmap header and everything that is in a bmp ... Bitmap headers from the data stream to get the offset to the data and format of colour values used by the file. ... You can now grab a pixel from the data stream by working out it's offset from the start of the data, however in most cases the DIB ...
    (microsoft.public.vb.winapi.graphics)

Loading