+(void)drawEllipse:(CGPoint)point withColor:(UIColor*)color withRad:(float)rad { CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(ctx, [color CGColor]); CGContextFillEllipseInRect(ctx, CGRectMake(point.x-rad, point.y-rad, 2*rad, 2*rad)); }
直接調用傳入參數就能夠了code