复制位图标头

时间:2014-04-24 11:59:52

标签: bitmap bmp

我做了这个strtuctre

 typedef struct
    {
        short int type;
        int taille;
        short int reserved;
        int offst;
        int header_size;
        int width;
        int height;
        short int plans;
        short int bitperpixel;
        int compression;
        int bmptaille;
        int Hresolu;
        int Vresolu;
        int nbcouleurs;
        int nbcouleursimp;
    } info_header;

然后我打开文件并验证它是否已使用此功能打开

void ouverture_file( FILE * fichier1)
{
    if (fichier1==NULL)
    printf("probleme ouverture fichier\n");
    else
    printf("fichier est bien ouvert\n");
}

(这段代码是主要的)

FILE* fichier=NULL;
    fichier= fopen("lena.bmp","rb+");
    ouverture_file(fichier);
    info_header * bmpheader=NULL;

现在我想知道如何将标题复制到infoheader结构中,然后打印像素开始的第一个八位字节。

0 个答案:

没有答案