问题描述
我想实现像元素周期表这个应用程序的多个click事件的应用程序,我想用大的图像,这和使图像点击从不同的不同的部分叫做元素在此实现缩放和滚动功能还包括:
I want to implement a application in this application multiple click event like periodic table i want to use large image for this and make image clickable from its different different part called element in this implementation zoom and scroll feature are also include
推荐答案
试试这个:
定义一个矩形的地点/区域,你想使点击。还记得基于屏幕的布局大小和分辨率redifine它。
Define a Rect for the spot/area that you would like to make clickable. Also remember to redifine it based on screen layout size and resolution.
现在onTouch事件得到x和y位置,并计算是否跑到了定义矩形内,并采取相应的行动。该Rects将作为虚拟图像映射。
Now onTouch event get the x and y position and calculate whether it lies within the defined Rect and act accordingly. The Rects will act as virtual image maps.
这篇关于如何让大图片点击不同的不同的图像部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!