M
M
mitekgrishkin2016-10-27 16:13:35
Android
mitekgrishkin, 2016-10-27 16:13:35

Is it possible to specify an image click mask in Android?

There is an image with different parts. For example, a car, like here:
car_parts.jpg
how can you make it so that when you tap a part of the image (bumper, wheel, mirror, etc.), you can change this part (paint or insert another painted piece).
Those. in fact, set the click mask.
So far I see this option: insert the main image into the bottom layer, changeable parts in a layer above. Such an ImageView group is obtained. But on different screens it will converge into some kind of mess.
What are better solutions?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mitekgrishkin, 2016-10-29
@mitekgrishkin

As a result, I decided to stop at the above option. I created a successor of RelativeLayout and add a list of pre-prepared images there. Each element is separately in a separate file. All images are the same size (we also create copies for different resolutions). I assign one as a background. I make the rest invisible, add a separate list to the layout. I fasten OnTouchListener. Then, when triggered, I take the coordinates of the click and run the list by color. For the desired element at such coordinates, the rgb color should differ from 000. Then it remains to change the visibility.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question