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.
+3
Sandeep jayan
source
to share
2 answers
int ColorCode = imageView.getDrawingCache().getPixel(x, y);
// here x, y are coordinates
here is the link
+2
Padma kumar
source
to share
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);
0
Bhavana Vadodariya
source
to share