那请问高手怎么读二值图像啊??我真的是有急用啊!!万分感谢了啊!!小弟这里请教了!!
void __fastcall TForm1::Button2Click(TObject *Sender)
{
lpSrc = new Graphics::TBitmap;
lpDst = new Graphics::TBitmap;
if(OpenPictureDialog1->Execute())
{
FileName = OpenPictureDialog1->FileName;
lpSrc->PixelFormat = pf1bit;
lpDst->PixelFormat = pf1bit;
lpSrc->LoadFromFile(FileName);
}
//Form1->Canvas->Draw(0,0,lpSrc);
Byte *p;
Byte r;
for(int x = 0; x < lpSrc->Height; x++)
{
p = (Byte*)(lpSrc->ScanLine[x]);
for(int y = 0; y < lpSrc->Width; y++)
{
r = p[y];
}
}
/*int value;
for(int x = 0; x < lpSrc->Height; x++)
{
for(int y = 0; y < lpSrc->Width; y++)
{
value = lpSrc->Canvas->Pixels[y][x];
}
}*/
}
我用上述两种方法,用跟踪调试显示出来的值不一样的啊!请问是为什么??图像我已经转换成了二值图像了。帮我看看,谢谢!
老大咋又不来了呢??我在线等候的啊!!你有能读二值图像的程序的话,能发到我的邮箱里吗?lionli2005@hotmail.com 万分感谢!!!!