不是说BMP文件由文件头、位图信息头、颜色信息和图形数据四部分组成吗?我只去了如下的一个头,结果读一副bmp图片,读到的width和height很大,10000多 typedef struct { char type[2]; int fSize; int Reserved; int offset; int bHdrSize; int width; int height; short int planes; short int bitsPerPixel; int compression; int dataSize; int hResolution; int vResolution; int colors; int importantColors; }BITMAPHEADER;
typedef struct {
char type[2];
int fSize;
int Reserved;
int offset;
int bHdrSize;
int width;
int height;
short int planes;
short int bitsPerPixel;
int compression;
int dataSize;
int hResolution;
int vResolution;
int colors;
int importantColors;
}BITMAPHEADER;