ピクセルレベルで画像を操作する方法。ピクセルを並べ替えて画像から情報を抽出したい。この問題を解決するための助けをいただければ幸いです。
2 に答える
2
画像から情報を抽出するには、以下のコードが必要です
import android.graphics.Color;
int[] pixels = new int[myBitmap.getHeight()*myBitmap.getWidth()];
myBitmap.getPixels(pixels, 0, myBitmap.getWidth(), 0, 0, myBitmap.getWidth(), myBitmap.getHeight());
for (int i=0; i<myBitmap.getWidth()*5; i++)
pixels[i] = Color.BLUE;
myBitmap.setPixels(pixels, 0, myBitmap.getWidth(), 0, 0, myBitmap.getWidth(), myBitmap.getHeight());
于 2012-04-18T06:24:49.170 に答える
0
画像をビットマップにロードします。次に、次のような機能があります
Bitmap b = ...
int color = b.getPixel(x,y);
b.setPixel(x, y, color);
于 2012-04-18T06:12:52.950 に答える