该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
做两个bmp图片的差分,并新建一个bmp图,将差分的结果存入新建的位图中.程序如下,
#include
#include
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef long LONG;
typedef unsigned char BYTE;
typedef struct BITMAPFILEHEADER{
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffbits;
} BITMAPFILEHEADER,*PBITMAPFILEHEADER;
typedef struct BITMAPINFOHEADER{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPlesPerMeter;
LONG biYPlesPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER,*PBITMAPINFOHEADER;
typedef struct RGBQUAD{
BYTE rgbBlue;
BYTE rgbGreen;
BYTE rgbRed;
BYTE rgbReserved;
} RGBQUAD;
int main(int argc,char **argv)
{
BITMAPFILEHEADER mapfileheader;
BITMAPINFOHEADER mapinfoheader;
DWORD bfSize1=0;
DWORD bfSize2;
DWORD bfOffbits1;
DWORD bfOffbits2;
DWORD biWidth1;
DWORD biWidth2;
DWORD biHeight1;
DWORD biHeight2;
WORD biBitCount1;
WORD biBitCount2;
LONG biXPlesPerMeter1;
LONG biXPlesPerMeter2;
LONG biYPlesPerMeter1;
LONG biYPlesPerMeter2;
BYTE a;
BYTE b;
BYTE c;
FILE *fp1=0;
FILE *fp2=0;