画像をご覧ください。どうすれば2本の線の交点(緑色の丸い点)を取得できますか? 画像の内側をトリミングしたい。終了パスは、行の任意の場所です。
context = UIGraphicsGetCurrentContext();
CGContextBeginPath(context);
CGContextSetLineWidth(context, 1.0 * self.scale);
CGContextSetLineCap(context, kCGLineCapRound);
[[UIColor redColor] setStroke];
CGPoint firstPoint = CGPointFromString([self.touchPoints objectAtIndex:0]);
CGContextMoveToPoint(context, firstPoint.x, firstPoint.y);
for (NSString *pointString in self.touchPoints) {
CGPoint point = CGPointFromString(pointString);
CGContextAddLineToPoint(context, point.x, point.y);
}
CGContextStrokePath(context);
このコードは、線の描画に使用されます。線画は問題なく、トリミングも問題なく動作しています...しかし、交点が私の大きな問題です。私を助けてください。