如何让大图片点击不同的不同的图像部分 [英] how to make large image clickable on different different image part

查看:163
本文介绍了如何让大图片点击不同的不同的图像部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现像元素周期表这个应用程序的多个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.

这篇关于如何让大图片点击不同的不同的图像部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆