开发者

Get point coordinate on an image

I have an imageview which displays a part of the human body. What I want to do is to assign names to specific regions on the image.开发者_运维百科 I would like to put pis to certain places and whenever user taps on any of those pins display name and detail information about the touched part. Should I use an imageview or is there some other class to perform this?


you can use UIImageView and attach a UIGestureRecognizer to that image, like UITapGestureRecognizer if you want to get interaction with a finger tap. You can get the coordinates using -(CGPoint)locationInView:(UIView *)view


I recommend you use a UIResponder, and convert your image regions into separate images. In these images, use alpha = 0 to tile areas you dont want to be accepted as a click. Then in the code, bitmap the images and customly handle clicks. Then you can do a check to see if that click should be accepted. This link explains in alot more detail. How to create a transparent window with non-rectangular buttons?


Yes you can do this with the help of touches delegate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜