Search code examples
iphoneobjective-ciphone-sdk-3.0quartz-graphicsquartz-2d

How to make it circular on Iphone


I am unable to make it circular on iphone

 CGPoint addLines[] =
{
    CGPointMake(10.0, 90.0),
    CGPointMake(70.0, 60.0),
    CGPointMake(130.0, 120.0),
    CGPointMake(190.0, 150.0),
    CGPointMake(250.0, 60.0),
    CGPointMake(310.0, 90.0),
};
CGContextAddLines(context, addLines, sizeof(addLines)/sizeof(addLines[0]));
CGContextStrokePath(context);

Please dont post circular code, as I want to make irregular circular through lines, and how to make my edges smooth also, instead of sharp


Solution

  • You can Try like This-

    CGPoint addLines[] = {
        CGPointMake(10.0, 90.0),
        CGPointMake(70.0, 60.0),
        CGPointMake(70.0, 60.0), 
        CGPointMake(130.0, 120.0),
        ...
    };
    
    CGContextStrokeLineSegments(context, addLines,nooflines);