if((fp=fopen(FileName,"rb"))==NULL) //打开文件,并且判断文件是否存在
{
printf("open the file error!\n");
return -1;
}
fseek(fp,18,SEEK_SET);
fread(&g_Width,4,1,fp); //图象宽度 ok
fread(&g_Height,4,1,fp); //图象长度 ok
fseek(fp,14+4+4+4+2,SEEK_SET);
fread(&g_Bitcount,2,1,fp); //颜色数1,4,8,24,32