开发者

Finding specific points in UIView

开发者 https://www.devze.com 2023-02-09 19:58 出处:网络
Hey. I\'m building an iPad app and I need to mark specific points on top of a map (UIImageView). I have the coordinates in inches, but I\'m having trouble mapping 开发者_运维问答the inch-based coords

Hey. I'm building an iPad app and I need to mark specific points on top of a map (UIImageView). I have the coordinates in inches, but I'm having trouble mapping 开发者_运维问答the inch-based coords to iOS points, I've googled for hours and nothing too conclusive.

Any ideas?

Thank you.


So you have actual units and want to convert those to points?

The iPad screen has a 9.7" diagonal. In points, it's 1024x768. So, applying Pythagoras, that's 1280 points on the diagonal. Therefore the points per inch is very close to 132, which I've also seen given elsewhere without computation from first principles.

So, a distance of x inches is x * 132 points. E.g. 1.5" is 198 points.

0

精彩评论

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