int GetBmpHeader(BMPIMAGE* img) {
unsigned char headbuffer[INFOHEADSIZE];
BMPFILEHEAD *filehead = &img->filehead;
BMPINFOHEAD *infohead = &img->infohead;
if (fread(headbuffer, 1, FILEHEADSIZE, img->bmpfile) != FILEHEADSIZE) {
return FALSE;
}
img->filehead.bfType[0] = headbuffer[0];
img->filehead.bfType[1] = headbuffer[1];
if (*(unsigned short *)&filehead->bfType[0] != (0x4D42)) { /* 'BM' */
printf("file is not bmp\n\r");
return FALSE; /* not bmp image*/
}
(*(unsigned short *)&filehead->bfType[0] != (0x4D42))这句话难以理解,希望解释的清楚点,还有0x4D42是什么用的