android - clickable area of image -


i'am designing gui remote control, instead of making separate buttons each remote button, want full ready remote image , set parts of click-able. there way rather motion event this?

i have 2 solutions requirement.in both,the whole image stays clickable can information clicked area.

solution 1:

you can mask image , pixel color of underneath image.so can come know area has been clicked.

here,whenever clicked occurs,you can check pixel color of background image , match predefined color set know area has been clicked.

foreground image: foreground image

background image: background image

clickable area: representing clickable area

still confused?

reference: suggest go through this tutorial.

solution 2:

you can map image co-ordinates , accordingly can information of area has been clicked.

example: mappedimage co-ordinates

if not aware of co-ordinates,you can create mappedimage here

co-ordinates kansas this,

        <area shape="poly" coords="243,162,318,162,325,172,325,196,244,196" id="@+id/area14" name = "kansas"/> 

mappedimage co-ordinates

reference: please have @ android image mapping.

i hope helpful !!


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -