bing-ge
- (void)inArea
{
    CGMutablePathRef pathRef = CGPathCreateMutable();
    CGPathMoveToPoint(pathRef, NULL, 4, 4);
    CGPathAddLineToPoint(pathRef, NULL, 4, 14);
    CGPathAddLineToPoint(pathRef, NULL, 14, 14);
    CGPathAddLineToPoint(pathRef, NULL, 14, 4);
    CGPathAddLineToPoint(pathRef, NULL, 4, 4);
    CGPathCloseSubpath(pathRef);
    CGPoint point=CGPointMake(5, 5);
    CGPoint outPoint=CGPointMake(1, 1);
    if (CGPathContainsPoint(pathRef, NULL, point, NO)) { NSLog(@"point in path!");
    }
    if (!CGPathContainsPoint(pathRef, NULL, outPoint, NO)) { NSLog(@"outPoint out path!");
    }
}

分类:

技术点:

相关文章:

  • 2021-06-30
  • 2021-10-31
  • 2021-10-29
  • 2021-12-13
  • 2021-12-05
  • 2021-12-22
  • 2021-12-09
猜你喜欢
  • 2020-07-10
  • 2021-06-03
  • 2021-06-01
  • 2021-11-07
  • 2020-01-23
  • 2021-04-15
  • 2021-12-05
相关资源
相似解决方案