Ali
Ali

Reputation: 595

circle PNG image making it interactive on android

Well i have a circle image that i am using imageview to show in the app

I need someway to make parts of this image interactive like event should fire depend on which part of the image the user is clicking , i.e. if user is clicking on the center of the image or on one of the pie slices of the circle image

how this could be achived ?!

Upvotes: 0

Views: 448

Answers (1)

Xavjer
Xavjer

Reputation: 9226

One way would be slicing the image into the parts, then assigning a clickevent to each part with the appropriate reaction.

the other way could be to check on the clickevent where you have clicked (x,y) and check if it is in a range you defined as an area if it's in there.

or you have different colors of the slices, you then get the color of the clicked pixel and evaluate where it belongs to

Upvotes: 1

Related Questions