void CReadrawFileDlg::OnBnClickedButton2()
{
// TODO: 在此添加控件通知处理程序代码

FILE *billImage;
int imageHeight=188;
int imageWidth=448;

unsigned char billPixel[188][448];
unsigned char pixels[84224];

if((billImage=fopen("E:\\temp.raw", "rb"))==NULL)
{ //cout<<"cannot open file\n";
//exit(0);
}

fread(pixels, sizeof(unsigned char) , imageHeight*imageWidth, billImage);
int cout = 0;
for (int i=0; i<imageHeight; i++)
{
for (int j=0; j<imageWidth; j++)
{
int m=0;
billPixel[i][j]=pixels[m];
m++;
cout ++;
//if(cout==6)
//break;
}

}
for (int i=0; i<imageHeight; i++) {
for (int j=0; j<imageWidth; j++)
{
//cout<< billPixel[i][j];
}
}
fclose(billImage);

}

 

posted on 2012-04-05 23:54  瓦楞球  阅读(1286)  评论(0编辑  收藏  举报