Android SDK中提供了Bitmap图片每个像素颜色读取的方法:
public void getPixColor(){
Bitmap src = BitmapFactory.decodeResource(getResources(),R.drawable.imgbg);
int A, R, G, B;
int pixelColor;
int height = src.getHeight();
int width = src.getWidth();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
pixelColor = src.getPixel(x, y);
A = Color.alpha(pixelColor);
R......
阅读全文