简体   繁体   English

在UIImage视图中的图像上绘制折线

[英]Drawing polylines over Image in UIImage View

I want to draw polylines over and image loaded in an UIImageView. 我想在UIImageView上绘制折线并加载图像。

Can someone give me some tips on where to start? 有人可以给我一些从哪里开始的提示吗?

Thank you 谢谢

To draw polygon you should use the drawRect method located in UIView subclass. 要绘制多边形,您应该使用UIView子类中的drawRect方法。

So 2 solutions : 所以2解决方案:
1°) You subclass UIImageView and in drawRect you draw your image and draw your polylines then 1°)子类化UIImageView,并在drawRect中绘制图像并绘制折线,然后
2°) You have an UIImageView and on the top an UIView subclass where you draw your polylines 2°)您有一个UIImageView,顶部是一个UIView子类,您在其中绘制折线

Drawing the polylines won't be a problem (you should find an answer on stack). 绘制折线不会有问题(您应该在堆栈上找到答案)。 (like here : polyines on iphone ) (就像这里: iphone上的polyines

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM