FILE *fp=fopen("\\test.bmp","r");
BITMAPFILEHEADER fileheader;
BITMAPINFO info;
fread(&fileheader,sizeof(fileheader),1,fp);
if(fileheader.bfType!=0x4D42)
{//
fclose(fp);
return ;
}
UCHAR *buffer = NULL;
//
fread(&info.bmiHeader, sizeof(BITMAPINFOHEADER), 1, fp);
//
long width=info.bmiHeader.biWidth;
long lwidth = width;
/
long height=info.bmiHeader.biHeight;
long lheight = height;
DWORD size;
if (info.bmiHeader.biSizeImage != 0)
{//
size = info.bmiHeader.biSizeImage;
}
else
{//
size = info.bmiHeader.biHeight*info.bmiHeader.biWidth*3;
}
buffer = new UCHAR[size];//
if (buffer == NULL)
{//
delete[] buffer;
return;
}
//
fseek(fp,fileheader.bfOffBits,0);
fread(buffer,size,1,fp);
char pDecode[17];
memset(pDecode,0,20);
int ileng =20;
zxgDecode(buffer,640,480,0,0,640,480,pDecode,&ileng);
free(p);
///////////////////////
CString strx;
strx.Format(L"decode result is%d,%s",x,pDecode);
MessageBox(strx);
在 2012年7月5日星期四UTC+8下午9时28分04秒,hfneubauer写道: