在一个功能中,我正在使用UIBezierPath来绘制curves.In一个场景,我需要将UIBezierPath分解成关于一个常量的碎片(在设备横向x值512.0中).I不确定它是否可能,或者not.Is是否有任何wat可以做same.Please帮助我摆脱这种情况。提前谢谢。
我在我的应用程序中用于绘图的一些代码片段:
[bezierPath moveToPoint:mid1];
[drawingBezier addQuadCurveToPoint:mid2 controlPoint:previousPoint1];
[self setNeedsDisplay];发布于 2012-08-02 17:40:37
每个边框路径都有两个点(起点和终点)。
在触摸开始时事件
UITouch *mytouch=[[touches allObjects] objectAtIndex:0];
[myPath moveToPoint:[mytouch locationInView:self]]; // points (X1,y1)在触摸移动事件中
UITouch *mytouch=[[touches allObjects] objectAtIndex:0];
[myPath addLineToPoint:[mytouch locationInView:self]]; // points (X2,y2)现在使用(x1,x2)和(y1,y2)值分割mypath行。x1=500、x2= 700、y1=250、y2 = 500和new x= (x1+x2/2) y= (y1+y2/2) (根据您的要求计算新点)调用drawRect来绘制直线。
https://stackoverflow.com/questions/10717203
复制相似问题