C4Swimmers Newsletter  

(Source Code) How to use BitMap in Turbo C++

Source Code : How to use BitMap in Turbo C++

NOTE :Before Running this program you have to copy one file in your "bgi" directory. That file either you have to download from the net or i will provide you. The file name is "SVGA256.BGI". Copy this file at your " tc\bgi\ ". Your tc path. I am not able to attach this file because the file extension is not supported.. If you need this file, i will provide you.

1) You have to use the BitMap structure, there is no need to change anything in this structure. Just copy this structure in one of the .cpp file like "BitMap.cpp".

Code: C

//BitMap Structure 
struct A{
    char type[2];         /* Magic identifier  */
    unsigned long size;        /* File size in bytes  */
    unsigned short int reserved1, reserved2;
    unsigned long offset;     /* Offset to image data, bytes */
};
extern A HEADER,HEADER1;
struct B{
    unsigned long size;           /* Header size in bytes      */
    unsigned long width,height;         /* Width and height of image */
    unsigned short int planes;    /* Number of colour planes   */
    unsigned short int bits;      /* Bits per pixel   */
    unsigned long compression;     /* Compression type  */
    unsigned long imagesize;        /* Image size in bytes  */
    unsigned long xresolution,yresolution;  /* Pixels per meter */
    unsigned long ncolours;      /* Number of colours  */
    unsigned long importantcolours;   /* Important colours   */
};
extern B INFOHEADER,INFOHEADER1;

[Read more..]

Courtesy:- Go4expert.com