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 .
ImageView
Please, help.
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 = Color.red(pixel); int blueValue = Color.blue(pixel); int greenValue = Color.green(pixel);