// 搬来的,供有需要的人参考
#include "Windows.h"
#include "stdio.h"
unsigned char* pBmpBuf; //读入图像数据的指针
int bmpWidth; //图像的宽
int bmpHeight; //图像的高
RGBQUAD* pColorTable; //颜色表指针
int biBitCount; //图像类型,每像素位数
/**************************************
* 函数名称:readBmp()
* 函数参数:
char* bmpName -- 文件名字及其路径
* 返回值:
0为失败,1为成功
* 说明: 给定一个图像文件名及其路径,读图像的位图数据
、宽、高、颜色表及每像素位数等数据进
内存,存放在相应的全局变量中
***************************************/
bool readBmp(char* bmpName){
//二进制读写方式打开指定的图像文件
FILE* fp = fopen(bmpName, "rb");
if(fp ==