Sunday, July 22, 2012

Get the color of a specific pixel Java Android example ?


ImputStream      is = this.getResources().openRawResource(R.drawable.colors);
Bitmap    mBitmap2 = BitmapFactory.decodeStream(is);

int  w = mBitmap2.getWidth();
int  h = mBitmap2.getHeight();
//  int x , y have to be smaller as w , h
int _color =  mBitmap2.getPixel(x, y);

No comments:

Post a Comment