使用 CGContextEOFillPath 查找区域
我有兴趣使用 CGContextEOFillPath 苹果提供的功能。我猜测 EOFill 的工作方式,它可能有一种方法来获取填充区域并计算面积。
所以我的问题是有谁知道如何使用 CGContextEOFillPath 并找到填充部分的区域。
如果这不是一件容易做到的事情,也许一些关于更好的方法的指示会有所帮助。虽然我需要使用 EO 风格的绘图。
谢谢。
I am interested in using the CGContextEOFillPath feature provided by apple. I am guessing with the way the EOFill works, it probably has a way to take the filled in areas and calculate an area.
So my question is does anyone know of a way to use CGContextEOFillPath and find the area of the filled in sections.
If this isn't something that is easily done, maybe some pointers to a better way of doing this would be helpful. Though I need to use the EO style graphing.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“计算面积”是什么意思?
比如计算复杂形状的表面积?
这取决于你的形状。
它们都是多边形吗?
那么圆圈呢?
有一些众所周知的计算多边形面积的公式。 (维基百科有它)该计算的一部分涉及使用 ABS() 函数,因为绘制的形状“逆时针”与“顺时针”绘制的符号相反。如果您想要模拟 EO 行为,您可以简单地忽略符号变化,因为对您来说,这是可取的。
如果您有涉及曲线的更复杂的形状,那么您需要将问题分解为多个部分 - 一部分解决多边形 - 一部分解决圆形 - 一部分解决其他形状,等等。
What do you mean "Calculate the area"?
As in calculate the surface area of a complex shape?
It depends on your shapes.
Are they all polygons?
What about circles?
There are well known formulas for calculating the area of a polygon. (Wikipedia has it) Part of that calculation involves using an ABS() function because shapes drawn "counterclockwise" have the opposite sign as those drawn "clockwise". If you're looking to simulate the EO behavior, you can simply ignore the sign change, because, for you, it's desirable.
If you have more complicated shapes that involve curves, then you need to break the problem down into multiple parts - one part to solve for polygons - one to solve for circles - one to solve for other shapes, etc.