如何将 CGContextAddArc 中的所有像素点存储到 NSMutableArray.or CGContextRef 到 NSMutable Array
static inline float radians(double degrees)
{
return degrees * PI / 180;
}
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGRect parentViewBounds = self.bounds;
CGFloat x = CGRectGetWidth(parentViewBounds)/2;
CGFloat y = CGRectGetHeight(parentViewBounds)/2;
UIColor *rbg=[UIColor redColor];
CGContextSetFillColor(context, CGColorGetComponents( [rbg CGColor]));
CGContextMoveToPoint(context, x, y);
CGContextAddArc(context, x, y,100,radians(35),radians(105),0);
CGContextClosePath(context);
CGContextFillPath(context);
// here I want to store All points Containing in the Arc to NSMutableArray
NSMutableArray *pointsArray=????
}
图片