I have an irregular shaped PNG image for example a round image where the corners are transparent.
How can I create an imagebutton of this image and not letting the corners being touchable?
If possible I may want to create other irregular shaped imagebuttons.
Check out the second answer to this question, I believe it's exactly what you need.
Later edit:
Quick summary:
Use a TouchListener
instead of ClickListener
Inside the listener, if the event is MotionEvent.ACTION_DOWN
, get the touch coordinates
Check the image's pixel at the coordinates you obtained earlier; if the pixel is not transparent, consider the button was clicked, otherwise ignore the event.