开发者

how to find out the coordinate of displayed UIImage in screen coordinate system?

开发者 https://www.devze.com 2023-02-25 00:28 出处:网络
If I touch the screen with UIImage displayed, i can get a coordinate of (screen.x, screen.y) in screen coordinate. And how can I get the UIImage coordinate (image.x, image.y) from this coordinate ? th

If I touch the screen with UIImage displayed, i can get a coordinate of (screen.x, screen.y) in screen coordinate. And how can I get the UIImage coordinate (image.x, image.y) from this coordinate ? the UIImage is in a U开发者_开发技巧IImageView.


So far, I havent found any property or something to get the coordinate of displayed UIImage directly. Yet after some calculation (using the aspect radio of original UIImage), the distance between the origin of displayed UIImage and UIImageView.frame could be easily find out. I worried about the error, but it turns out the error is very little, and I hardly can tell.

0

精彩评论

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