Question

I have this image:enter image description here

And in Android I want to drag on the image and get the x and y. But only on the dark part (but a imageview/button is a rectangle). So a sort of round OnTouchListener.

How can I manage to do this?

Was it helpful?

Solution

You able to do it by Get touched pixel color of ImageView.

So, Step you need:

 1. Get touched pixel color.

 2. Compare touched pixel color with your image color . it is black. 

So, you able to touched position in your desire image view position or not.

Thanks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top