Graphics::TBitmap *pBitmap = new Graphics::TBitmap();
Byte *ptr,Byte a[1000][1000];
pBitmap->LoadFromFile(OpenDialog1->FileName);
for(int y = 0; y < pBitmap->Height; y++)
{
ptr = (Byte *)pBitmap->ScanLine[y];
for(int x = 0; x < pBitmap->Width; x++)
{
a[x][y] = ptr[x]; // 將讀取的圖存入a陣列中,圖為512*512之8bit灰階圖
// 請問上一行為什麼不能直接用pBitmap這個指標來處理� // 如果是new配置空間的話,那pBitmap應該算是指向放置圖案的記憶空間
// 但是卻不能直接利用pBitmap取值來,這讓我很困惑
// 如果問題太蠢,請見諒~~~ 謝謝�
}
}
delete pBitmap; �
--
[m [1;33m※來源 : [1;36m 台北科大計中紅樓資訊站 [1;35mredbbs.cc.ntut.edu.tw
[1;32m※FROM : [1;37m61.59.255.150 [m