C Builder相談室 Part3
■ このスレッドは過去ログ倉庫に格納されています
0807デフォルトの名無しさん
NGNGTColor c=bg->Canvas->Pixels[x][y];
で(x,y)座標のピクセルの色を取り出せる。
もっと高速に処理したいなら以下の方法を使う。
void f(Graphics::TBitmap* bg)
{
for(int k=0;k<bg->Height;k++)
{
Byte* line=(Byte*)bg->ScanLine[k];
int i,j;
for(i=0;i<bg->Width;i++)
{
j=i*3;
Byte blue=line[j];
Byte green=line[j+1];
Byte red=line[j+2];
}
}
}
この例はビットマップの形式に依存するので注意
Graphics::TBitmap* bg=new Graphics::TBitmap();
bg->HandleType=bmDIB;
bg->PixelFormat=pf24bit;
■ このスレッドは過去ログ倉庫に格納されています