當前位置:首頁 » 編程語言 » c語言讀取bmp文件
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

c語言讀取bmp文件

發布時間: 2022-02-25 20:49:40

⑴ 用c語言讀取24位點陣圖bmp文件

可以使用C語言標准函數庫中的fopen、fseek、fclose等系列函數來打開bmp點陣圖文件,以及進行相應的處理,下面是一個demo,僅供參考。以下代碼在vc6.0中編譯通過。


#include<stdio.h>
#include<stdlib.h>
#//ThebmpFileHeaderlengthis14
#defineBM19778//TheASCIIcodeforBM
/*Testthefileisbmpfileornot*/
voidbmpFileTest(FILE*fpbmp);
/**/
voidbmpHeaderPartLength(FILE*fpbmp);
/**/
voidBmpWidthHeight(FILE*fpbmp);
//getr,g,bdata
voidbmpDataPart(FILE*fpbmp);
//
voidbmpoutput(FILE*fpout);
unsignedintOffSet=0;//
longwidth;//TheWidthoftheDataPart
longheight;//TheHeightoftheDataPart
unsignedcharr[2000][2000],output_r[2000][2000];
unsignedcharg[2000][2000],output_g[2000][2000];
unsignedcharb[2000][2000],output_b[2000][2000];
intmain(intargc,char*argv[])
{
/*Openbmpfile*/
unsignedchar*fp_temp;
FILE*fpbmp;
FILE*fpout;
fpbmp=fopen("1.bmp","rb");
if(fpbmp==NULL)
{
printf("Openbmpfailed!!! ");
return1;
}
fpout=fopen("out.bmp","wb+");
if(fpout==NULL)
{
printf("Openout.bmpfailed!!! ");
return1;
}

bmpFileTest(fpbmp);//Testthefileisbmpfileornot
bmpHeaderPartLength(fpbmp);//GetthelengthofHeaderPart
BmpWidthHeight(fpbmp);//


//
fseek(fpbmp,0L,SEEK_SET);
fseek(fpout,0L,SEEK_SET);

fp_temp=(unsignedchar*)malloc(OffSet);
fread(fp_temp,1,OffSet,fpbmp);
fwrite(fp_temp,1,OffSet,fpout);

bmpDataPart(fpbmp);//Reservethedatatofile

/*


如果您想對圖片進行處理,請您再這里插入處理函數!!!!!!!!!!!!!!!!!!

*/
bmpoutput(fpout);
fclose(fpbmp);
fclose(fpout);
return0;
}
voidbmpoutput(FILE*fpout)
{
inti,j=0;
intstride;
unsignedchar*pixout=NULL;

stride=(24*width+31)/8;
stride=stride/4*4;
pixout=(unsignedchar*)malloc(stride);

fseek(fpout,OffSet,SEEK_SET);
for(j=0;j<height;j++)
{
for(i=0;i<width;i++)
{
pixout[i*3+2]=output_r[height-1-j][i];
pixout[i*3+1]=output_g[height-1-j][i];
pixout[i*3]=output_b[height-1-j][i];
}
fwrite(pixout,1,stride,fpout);
}
}
voidbmpDataPart(FILE*fpbmp)
{
inti,j=0;
intstride;
unsignedchar*pix=NULL;
FILE*fpr;
FILE*fpg;
FILE*fpb;

if((fpr=fopen("bmpr.txt","w+"))==NULL)
{
printf("Failedtoconstructfilebmpr.txt.!!!");
exit(1);
}
if((fpg=fopen("bmpg.txt","w+"))==NULL)
{
printf("Failedtoconstructfilebmpg.txt.!!!");
exit(1);
}
if((fpb=fopen("bmpb.txt","w+"))==NULL)
{
printf("Failedtoconstructfilebmpb.txt.!!!");
exit(1);
}

fseek(fpbmp,OffSet,SEEK_SET);
stride=(24*width+31)/8;
stride=stride/4*4;
pix=(unsignedchar*)malloc(stride);

for(j=0;j<height;j++)
{
fread(pix,1,stride,fpbmp);
for(i=0;i<width;i++)
{
r[height-1-j][i]=pix[i*3+2];
g[height-1-j][i]=pix[i*3+1];
b[height-1-j][i]=pix[i*3];
output_r[height-1-j][i]=pix[i*3+2];
output_g[height-1-j][i]=pix[i*3+1];
output_b[height-1-j][i]=pix[i*3];
}
}
for(i=0;i<height;i++)
{
for(j=0;j<width-1;j++)
{
fprintf(fpb,"%4d",b[i][j]);
fprintf(fpg,"%4d",g[i][j]);
fprintf(fpr,"%4d",r[i][j]);
}
fprintf(fpb,"%4d ",b[i][j]);
fprintf(fpg,"%4d ",g[i][j]);
fprintf(fpr,"%4d ",r[i][j]);
}

fclose(fpr);
fclose(fpg);
fclose(fpb);

}
voidbmpFileTest(FILE*fpbmp)
{
unsignedshortbfType=0;

fseek(fpbmp,0L,SEEK_SET);//seek_set起始位置
fread(&bfType,sizeof(char),2,fpbmp);
if(BM!=bfType)
{
printf("Thisfileisnotbmpfile.!!! ");
exit(1);
}
}
/**/
voidbmpHeaderPartLength(FILE*fpbmp)
{
fseek(fpbmp,10L,SEEK_SET);
fread(&OffSet,sizeof(char),4,fpbmp);
printf("TheHeaderPartisoflength%d. ",OffSet);
}
/**/
voidBmpWidthHeight(FILE*fpbmp)
{
fseek(fpbmp,18L,SEEK_SET);
fread(&width,sizeof(char),4,fpbmp);
fseek(fpbmp,22L,SEEK_SET);
fread(&height,sizeof(char),4,fpbmp);
printf("TheWidthofthebmpfileis%ld. ",width);
printf("TheHeightofthebmpfileis%ld. ",height);
}

⑵ C語言 讀取並顯示bmp圖像文件

打開.bmp有兩種方法,
一種是讀數據而已,對數據操作,再送回.bmp文件中.
第二種你想在C中看到圖片,那就麻煩啦,你要中斷10H功能鍵.然後讀進來,而且不可以讀太大的圖片,要讀太大的圖片還要考慮擴充內存的問題.

要是你只是想用C的程序去打開一個.bmp圖片,而圖片不是在C中顯示,而是用別的圖片瀏覽工具的話,哈哈~~剛剛找了挺久的,沒找到答案,要是你找到了盡快告訴我。我Q313208612

⑶ C語言怎麼讀入一個bmp文件,並顯示(一定要C語言,附代碼)

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <malloc.h>

#define WIDTHBYTES(i) ((i+31)/32*4)
//#pragma warning(disable: 4996)
int main()
{
BITMAPFILEHEADER bf; //BMP文件頭結構體
BITMAPINFOHEADER bi; //BMP信息頭結構體

FILE* fp; //指向文件的指針
RGBQUAD *ipRGB; //
DWORD LineByte,ImgSize;
DWORD NumColors;
long Width;
unsigned char * * Imgdata;
int i,j;
char fileName[256];

//打開文件
printf("please enter filename:");
scanf("%s",fileName);
fp=fopen(fileName,"rb");
if(fp == NULL){
printf("Open file error!");
exit(0);
}

//讀取信息頭、文件頭
fread(&bf,sizeof(BITMAPFILEHEADER),1,fp); //把指針fp所指向的文件的頭信息寫入bf(地址)
fread(&bi,sizeof(BITMAPINFOHEADER),1,fp);

LineByte=(DWORD)WIDTHBYTES(bi.biWidth*bi.biBitCount); //計算點陣圖的實際寬度並確保它為32的倍數
ImgSize=(DWORD)LineByte*bi.biHeight;

if (bi.biClrUsed != 0 )
NumColors=(DWORD)bi.biClrUsed;
else
switch (bi.biBitCount)
{
case 1:NumColors=2;break;
case 4:NumColors=16;break;
case 8:NumColors=256;break;
case 24:NumColors=0;break;
}
//分配調色板內存
if(bi.biBitCount < 24){
ipRGB=(RGBQUAD *)malloc(NumColors*sizeof(RGBQUAD));
fread(ipRGB,sizeof(RGBQUAD),NumColors,fp);
}

Imgdata=new unsigned char*[bi.biHeight]; //聲明一個指針數組
if(bi.biBitCount >= 24){
// fseek(fp, 4, SEEK_CUR);//sizeof(RGBQUAD)
Width = bi.biWidth*3;
} else{
Width = bi.biWidth;
}

for ( i=(bi.biHeight)-1;i>=0;i--)
Imgdata[i]=new unsigned char[Width]; //每個數組元素也是一個指針數組

for ( i=(bi.biHeight)-1;i>=0;i--)
for(j=0;j<Width;j++)
fread(&Imgdata[i][j],1,1,fp);//每次只讀取一個1位元組,存入數組

fclose(fp);
//寫入另一個文件
fp=fopen("mybmp.bmp","wb");
fwrite(&bf,sizeof(BITMAPFILEHEADER),1,fp);
fwrite(&bi,sizeof(BITMAPINFOHEADER),1,fp);

if(bi.biBitCount < 24){
fwrite(ipRGB,sizeof(RGBQUAD),NumColors,fp);
}
for (i=(bi.biHeight)-1 ;i>=0;i--)
for (j=0 ;j<Width;j++) {
Imgdata[i][j] = 255 - Imgdata[i][j];
fwrite(&Imgdata[i][j],1,1,fp);
}

free(Imgdata);
fclose(fp);
return 0;

}

⑷ C語言讀取BMP文件

呵呵,天哪

⑸ C語言 讀取BMP文件

讀取文件方法:先定義一個int類型的文件描述符變數,再用open函數(適合在Unix或Linux環境下,若是在windows環境下應先定義一個FILE類型的指針變數,再調用fopen函數)打開所要讀取的BMP文件即可。如果你要更改BMP文件的顏色,那麼就看你對BMP格式的圖片的存儲原理知道多少了,bmp是無損壓縮圖片的一種演算法,一般是由圖片頭部,文件頭部,顏色表等組成,要改變顏色,就需要改變顏色表中的內容,當然由於BMP演算法在不斷改進,其過程和組成部分可能有變化,上面的僅是一般情況。

⑹ c語言,怎樣讀取一個BMP圖片

#ifndef IMAGE_H
#define IMAGE_H
void image_info(FILE* file);
void image_save(FILE *file);
void image_gray();
void image_binarization();
void image_opposite();
void image_channel(); //抽取RGB通道
void image_bright();//改變圖像亮度

typedef struct BMP
{
//14位元組
unsigned short bfType; //文件標識 2位元組 必須為BM
unsigned int bfSize; //文件大小 4位元組
unsigned short bfReserved1; //保留,每位元組以"00"填寫 2位元組
unsigned short bfReserved2; //同上 2位元組
unsigned int bfOffBits; //記錄圖像數據區的起始位置(圖象數據相對於文件頭位元組的偏移量)。 4位元組

//40位元組
unsigned int biSize; //表示本結構的大小 4位元組
int biWidth; //點陣圖的寬度 4位元組
int biHeight; //點陣圖的高度 4位元組
unsigned short biPlanes; //永遠為1 , 2位元組
unsigned short biBitCount; //點陣圖的位數 分為1 4 8 16 24 32 2位元組
unsigned int biCompression; //壓縮說明 4位元組
unsigned int biSizeImage; //表示點陣圖數據區域的大小以位元組為單位 4位元組
int biXPelsPerMeter; //用象素/米表示的水平解析度 4位元組
int biYPelsPerMeter; //用象素/米表示的垂直解析度 4位元組
unsigned int biClrUsed; //點陣圖使用的顏色索引數 4位元組
unsigned int biClrImportant; //對圖象顯示有重要影響的顏色索引的數目 4位元組

} BMP;

int line_byte;
unsigned char *imagedata;
extern BMP bmp;
extern int line_byte;
extern unsigned char *imagedata;
#endif

//image_rw.c文件

#include<stdio.h>
#include<stdlib.h>
#include"image.h"

void image_info(FILE *file)
{

int times=3; //輸入文件名次數。
char bmp_name[10]; //文件名

printf("\nplease enter a file name for reading:");
do
{
if (times<3)
{
printf("\nplease enter a file name for reading again:");
}
fflush(stdin);
gets(bmp_name);
//printf("\n%s",bmp_name);
file=fopen(bmp_name,"rb+"); //打開一個文件進行讀寫操作。
--times;
if (file==NULL)
{
printf("\nerror opening %s for reading! ",bmp_name);
}
else
{
break;
}
}
while(times!=0);

if (times==0)
{
printf("\nsorry, shutdown!");
exit(1);
}

//讀取圖像信息

fseek(file,0L,0); //讀取圖像文件類型
fread(&bmp,sizeof(BMP),1,file);
printf("\n bmp tpye: %u",bmp.bfType);
printf("\n bmp size: %u",bmp.bfSize);
printf("\n bmp reserved1: %u",bmp.bfReserved1);
printf("\n bmp reserved2: %u",bmp.bfReserved2);
printf("\n bmp offBits: %u",bmp.bfOffBits);

printf("\n bmp bisize: %u",bmp.biSize);
printf("\n bmp biWidth: %d",bmp.biWidth);
printf("\n bmp biHeight: %d",bmp.biHeight);
printf("\n bmp biplans: %u",bmp.biPlanes);
printf("\n bmp biBitCount: %u",bmp.biBitCount);
printf("\n bmp biCompression: %u",bmp.biCompression);
printf("\n bmp biSizeImage: %u",bmp.biSizeImage);
printf("\n bmp biXPelsPerMeter: %d",bmp.biXPelsPerMeter);
printf("\n bmp biYPelsPerMeter: %d",bmp.biYPelsPerMeter);
printf("\n bmp biClrUsed: %u",bmp.biClrUsed);
printf("\n bmp biClrImportant: %u\n",bmp.biClrImportant);

line_byte=(bmp.biWidth*bmp.biBitCount/8+3)/4*4; //獲得圖像數據每行的數據個數
//printf("dfsa%u",bmp.line_byte);
//bmp.imagedata=NULL;
imagedata=(unsigned char*)malloc(bmp.biSizeImage);

fseek(file,(long)bmp.bfOffBits,0);
fread(imagedata,sizeof(unsigned char),bmp.biSizeImage,file);

fclose(file);
}

//保存圖像
void image_save(FILE *file)
{
int times=3; //輸入文件名次數。
char bmp_name[10]; //文件名
//int i; //記錄數據區個數

printf("\nplease enter a file name for writeing:");
do
{
if (times<3)
{
printf("\nplease enter a file name for writeing again:");
}
fflush(stdin);
gets(bmp_name);
printf("\n%s",bmp_name);
file=fopen(bmp_name,"wb+"); //打開一個文件進行讀寫操作。
--times;
if (file==NULL)
{
printf("\nerror opening %s for writing",bmp_name);
}
else
{
break;
}
}
while(times!=0);

if (times==0)
{
printf("\nsorry, shutdown!");
exit(1);
}

//寫文件頭
printf("\n%s",bmp_name);
fseek(file,0L,0); //圖像文件類型
fwrite(&(bmp.bfType),sizeof(short),1,file);
printf("\n bmp tpye: %d",bmp.bfType);

fseek(file,2L,0); //圖像文件大小
fwrite(&(bmp.bfSize),sizeof(int),1,file);
printf("\n bmp size: %d",bmp.bfSize);

fseek(file,6L,0); //圖像文件保留字1
fwrite(&(bmp.bfReserved1),sizeof(short),1,file);
printf("\n bmp reserved1: %d",bmp.bfReserved1);

fseek(file,8L,0); //圖像文件保留字2
fwrite(&(bmp.bfReserved2),sizeof(short),1,file);
printf("\n bmp reserved2: %d",bmp.bfReserved2);

fseek(file,10L,0);//數據區的偏移量
fwrite(&(bmp.bfOffBits),sizeof(short),1,file);
printf("\n bmp offBits: %d",bmp.bfOffBits);

fseek(file,14L,0);//文件頭結構大小
fwrite(&(bmp.biSize),sizeof(int),1,file);
printf("\n bmp bisize: %d",bmp.biSize);

fseek(file,18L,0);//圖像的寬度
fwrite(&(bmp.biWidth),sizeof(int),1,file);
printf("\n bmp biWidth: %d",bmp.biWidth);

fseek(file,22L,0);//圖像的高度
fwrite(&(bmp.biHeight),sizeof(int),1,file);
printf("\n bmp biHeight: %d",bmp.biHeight);

fseek(file,24L,0);//圖像的面數
fwrite(&(bmp.biPlanes),sizeof(short),1,file);
printf("\n bmp biplans: %d",bmp.biPlanes);

fseek(file,28L,0);//圖像一個像素的位元組數
fwrite(&(bmp.biBitCount),sizeof(short),1,file);
printf("\n bmp biBitCount: %d",bmp.biBitCount);

fseek(file,30L,0);//圖像壓縮信息
fwrite(&(bmp.biCompression),sizeof(short),1,file);
printf("\n bmp biCompression: %d",bmp.biCompression);

fseek(file,34L,0);//圖像數據區的大小
fwrite(&(bmp.biSizeImage),sizeof(int),1,file);
printf("\n bmp biSizeImage: %d",bmp.biSizeImage);

fseek(file,38L,0);//水平解析度
fwrite(&(bmp.biXPelsPerMeter),sizeof(int),1,file);
printf("\n bmp biXPelsPerMeter: %d",bmp.biXPelsPerMeter);

fseek(file,42L,0);//垂直解析度
fwrite(&(bmp.biYPelsPerMeter),sizeof(int),1,file);
printf("\n bmp biYPelsPerMeter: %d",bmp.biYPelsPerMeter);

fseek(file,46L,0);//顏色索引數
fwrite(&(bmp.biClrUsed),sizeof(int),1,file);
printf("\n bmp biClrUsed: %d",bmp.biClrUsed);

fseek(file,50L,0);//重要顏色索引數
fwrite(&(bmp.biClrImportant),sizeof(int),1,file);
printf("\n bmp biClrImportant: %d\n",bmp.biClrImportant);

fseek(file,(long)(bmp.bfOffBits),0);
fwrite(imagedata,sizeof(unsigned char),bmp.biSizeImage,file);

fclose(file);
}

//pixProcess.c文件

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include"image.h"

//灰度化
void image_gray()
{
int i,j;
unsigned char tmp;
for (i=0;i<bmp.biHeight;i++)
{
for (j=0;j<line_byte/3;j++)
{
tmp=0.11*(*(imagedata+i*line_byte+j*3+0))+0.59*(*(imagedata+i*line_byte+j*3+1))+0.3*(*(imagedata+i*line_byte+j*3+2));
imagedata[i*line_byte+j*3+0]=tmp;
imagedata[i*line_byte+j*3+1]=tmp;
imagedata[i*line_byte+j*3+2]=tmp;
//printf("\nnidsfh%d %d",i,j);
}
}
}

//二值化

void image_binarization()
{
int i,j;
for (i=0;i<bmp.biHeight;i++)
{
for (j=0;j<line_byte;j++)
{
if ((*(imagedata+i*line_byte+j))<128)
{
imagedata[i*line_byte+j]=0;
}
else
{
imagedata[i*line_byte+j]=255;
}
}
}
}

void image_opposite() //反相
{
int i,j;
for (i=0;i<bmp.biHeight;i++)
{
for (j=0;j<line_byte;j++)
{
imagedata[i*line_byte+j]=abs(255-imagedata[i*line_byte+j]);
}
}
}

void image_channel() //抽取RGB通道
{
int i,j;
char rgb;
printf("\nplease enter a char(r/g/b): ");
fflush(stdin);
scanf("%c",&rgb);
if (rgb=='b')
{
for (i=0;i<bmp.biHeight;i++)
{
for (j=0;j<line_byte/3;j++)
{
imagedata[i*line_byte+3*j+1]=0;
imagedata[i*line_byte+3*j+2]=0;
}
}
}
else if(rgb=='g')
{
for (i=0;i<bmp.biHeight;i++)
{
for (j=0;j<line_byte/3;j++)
{
imagedata[i*line_byte+3*j]=0;
imagedata[i*line_byte+3*j+2]=0;
}
}
}
else
{
for (i=0;i<bmp.biHeight;i++)
{
for (j=0;j<line_byte/3;j++)
{
imagedata[i*line_byte+3*j]=0;
imagedata[i*line_byte+3*j+1]=0;
}
}
}

}

void image_bright()//改變圖像亮度
{
int level;
int i,j;
printf("\n please enter the level of brightness[-255 to 255] :");
fflush(stdin);
scanf("%d",&level);
for (i=0;i<bmp.biHeight;i++)
{
for (j=0;j<line_byte;j++)
{
if (level>=0)
{

if ((imagedata[i*line_byte+j]+level)>255)
imagedata[i*line_byte+j]=255;
else
imagedata[i*line_byte+j]+=level;
}
else
{
if ((imagedata[i*line_byte+j]-abs(level))<0)
imagedata[i*line_byte+j]=0;
else
imagedata[i*line_byte+j]+=level;
}

}
}
}

//void image_create() //創建一幅24位BMP圖像文件。
//{

//main.c文件

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
#include"image.h"

BMP bmp;

int main()
{
FILE *file=NULL;
int choose;
char gono;
do
{
image_info(file); //imagedata已經分配了動態內存,但是沒有釋放

printf("\n 1.image_opposite");
printf("\n 2.image_gray");
printf("\n 3.image_binarization");
printf("\n 4.image_channel");
printf("\n 5.image_brightness");
//printf("6.image_opposite");
//printf("7.image_opposite");

printf("\nchoose your options:");
fflush(stdin);
scanf("%d",&choose);
switch(choose)
{

case 1:
image_opposite();
image_save(file);
free(imagedata);
break;
case 2:
image_gray();
image_save(file);
free(imagedata);
break;
case 3:
image_binarization();
image_save(file);
free(imagedata);
break;
case 4:
image_channel();
image_save(file);
free(imagedata);
break;
case 5:
image_bright();
image_save(file);
free(imagedata);
break;
default:
printf("\n wrong choose!");

}

printf("\nlet's go on?(y/n):");
fflush(stdin);
scanf("%c",&gono);
if (gono=='n')
{
printf("\nbye bye!");
break;
}
}
while(1);

return 0;
}

⑺ 用c語言讀取bmp文件

「error!」
說明打開文件失敗呀,看下你的文件存在與否d:\\a.bmp

⑻ C語言讀取bmp文件

你先看一下文件的打開方法,然後好好看看bmp的文件格式,文件頭里的存儲格式以及bmp圖像數據的存儲格式,最後顯示你可以寫文件顯示也可以使用編程工具。

⑼ 怎麼用C語言中的fopen函數打開bmp格式的圖像文件

1.圖片也是屬於文件類型的一種,圖片屬於二進制文件。使用fopen函數的二進制模式「rb」就可以打開。

2.常式:

#include<stdlib.h>
#include<stdio.h>
intmain()
{
FILE*fpPhoto,*fpText,*fpTarget;
intiRead;
charszBuf[100];

printf("請輸入第一個文件名(jpg): ");
gets(szBuf);
fpPhoto=fopen(szBuf,"rb");
printf("請輸入第二個文件名(txt): ");
gets(szBuf);
fpText=fopen(szBuf,"rb");
printf("請輸入目的文件名(jpg): ");
gets(szBuf);
fpTarget=fopen(szBuf,"wb");

if(!fpPhoto||!fpText||!fpTarget)
{
printf("打開文件失敗! ");
system("pause");
return-1;
}

while((iRead=fread(szBuf,1,sizeof(szBuf),fpPhoto))>0)
fwrite(szBuf,1,iRead,fpTarget);
while((iRead=fread(szBuf,1,sizeof(szBuf),fpText))>0)
fwrite(szBuf,1,iRead,fpTarget);

fclose(fpPhoto);
fclose(fpText);
fclose(fpTarget);
return0;
}

⑽ 用C語言怎麼讀取BMP格式的圖片

沒有標准函數讀。
需要根據BMP文件的結構定義,讀出頭部和每個顏色值。
struct
header
{
unsigned
short
int
bfType;
unsigned
int
bfSize;
unsigned
short
int
bfReserved1;
unsigned
short
int
bfReserved2;
unsigned
int
bfoffBits;
}__attribute__
((packed));
struct
tinfoheader
{
unsigned
int
biSize;
unsigned
int
biWidth;
unsigned
int
biHeight;
unsigned
short
int
biPlanes;
unsigned
short
int
biBitCount;
unsigned
int
biCompression;
unsigned
int
biSizeImage;
unsigned
int
biXPelsPerMeter;
unsigned
int
biYPelsPerMeter;
unsigned
int
biClrUsed;
unsigned
int
biClrImportant;
}__attribute__
((packed));