BMP draw.......

Discussion in 'C Programming' started by vicky, Sep 1, 2008.

  1. vicky

    vicky Guest

    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

    Can u also give over view of this structure ...as what is uFlag and
    dTransColor ...
     
    vicky, Sep 1, 2008
    #1
    1. Advertising

  2. vicky pisze:
    > 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
    >
    > Can u also give over view of this structure ...as what is uFlag and
    > dTransColor ...

    Maybe this helps :

    http://local.wasp.uwa.edu.au/~pbourke/dataformats/bmp/
    http://entropymine.com/jason/bmpsuite/

    What do you think about creating PPM files ? Its simpler.

    http://fraktal.republika.pl/g_file.html

    Regards

    Adam
     
    adam majewski, Sep 1, 2008
    #2
    1. Advertising

  3. On Mon, 1 Sep 2008 10:59:48 -0700 (PDT), vicky
    <> 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
    >
    >Can u also give over view of this structure ...as what is uFlag and
    >dTransColor ...


    This not a question about the C language but about a library package
    (apparently written in C). If the "window" you refer to is Windows,
    you will have better luck asking in one of the Windows or Microsoft
    groups. If you are referring to OpenWin, you could ask in a Unix
    group.

    --
    Remove del for email
     
    Barry Schwarz, Sep 1, 2008
    #3
  4. vicky

    MisterE Guest

    vicky 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
    >
    > Can u also give over view of this structure ...as what is uFlag and
    > dTransColor ...


    You have been missinformed. The header is (assuming unsigned short is 2
    bytes and unsigned int is 4 bytes):


    unsigned short bfType;
    unsigned int bfSize;
    unsigned short bfReserved1;
    unsigned short bfReserved2;
    unsigned int bOffBits;
    unsigned int biSize;
    unsigned int biWidth;
    unsigned int biHeight;
    unsigned short biPlanes;
    unsigned short biBitCount;
    unsigned int biCompression;
    unsigned int biSizeImage;
    unsigned int biXPelsPerMeter;
    unsigned int biYPelsPerMeter;
    unsigned int biClrUsed;
    unsigned int biClrImportant;

    What you have posted seems to be a struct for something that is nothing
    to do with a BMP file, but just some format a program uses after it has
    read the file.

    (Even the wikipedia page on BMP will give you this sort of info go and
    read about BMP format there)
     
    MisterE, Sep 18, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Allan Herriman

    Re: VHDL testbench: read BMP Files?

    Allan Herriman, Aug 21, 2003, in forum: VHDL
    Replies:
    1
    Views:
    5,220
    Allan Herriman
    Aug 21, 2003
  2. Martin Thompson

    Re: VHDL testbench: read BMP Files?

    Martin Thompson, Aug 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    1,011
    Martin Thompson
    Aug 21, 2003
  3. Amontec Team, Laurent Gauch

    Re: VHDL testbench: read BMP Files?

    Amontec Team, Laurent Gauch, Aug 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    778
    Amontec Team, Laurent Gauch
    Aug 21, 2003
  4. Mike Treseler

    Re: VHDL testbench: read BMP Files?

    Mike Treseler, Aug 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    787
    Mike Treseler
    Aug 21, 2003
  5. Harry Simpson

    32 dpp BMP to 24dpp BMP??

    Harry Simpson, Oct 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    364
    Harry Simpson
    Oct 30, 2003
Loading...

Share This Page