Huseyin
Huseyin

Reputation: 567

Android - How can i split image to specific shapes(not rectangle or square)

I want create images for each state.. (texas,montana,california.....)

Example image USA map : enter image description here

I tried put images over and over for each states like below (50 states, 50 images)..

For example Texas image : enter image description here

It was bad way.. Can i achieve this another way? or different opinion?

Upvotes: 2

Views: 400

Answers (2)

RugbyPlayingWhovian
RugbyPlayingWhovian

Reputation: 21

Use free crop in PicsArt. Go to edit and select the picture. Select tools and then free crop. Colour in the bit you want to keep and save it. I hope this helps!

Upvotes: 2

Vladyslav Matviienko
Vladyslav Matviienko

Reputation: 10881

I'd suggest you using 2 ImageViews - one on the top of another. On the bottom ImageView you can draw image of whole map without the State names.
On the top ImageView you can draw the names only.

Then you set onTouchListener to the ImageView, and on touch you just get the color of touched pixel. After that you match touched color with the state colors, and this way you know, which state was clicked.

For this every state has to have it's own color.

Upvotes: 1

Related Questions