Get rgb value of image when user clicked on image

I am creating a map application. I need to get the RGB value of an image when the user clicked on the image. The image is in ImageView


Please, help.


source to share

2 answers

int ColorCode = imageView.getDrawingCache().getPixel(x, y);


// here x, y are coordinates

here is the link



Bitmap bitmap = ((BitmapDrawable)imageView.getBackground()).getBitmap();  
int pixel = bitmap.getPixel(xCordinate,yCordinate);  
int redValue =;  
int blueValue =;  
int greenValue =;




All Articles