Skip to content

Instantly share code, notes, and snippets.

@xdream86
Created August 25, 2013 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdream86/6331760 to your computer and use it in GitHub Desktop.
Save xdream86/6331760 to your computer and use it in GitHub Desktop.
int ox = 50, oy = 50, r = 10, rw = 100, rh = 100;
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL,ox, oy+r);
CGPathAddArcToPoint(path, NULL, ox, oy+rh, ox+r,oy+rh, r);
CGPathAddArcToPoint(path, NULL, ox+rw, oy+rh, ox+rw, oy+rh-r, r);
CGPathAddArcToPoint(path, NULL, ox+rw, oy, ox+rw-r, oy, r);
CGPathAddArcToPoint(path, NULL, ox, oy, ox,oy+r,r);
CGContextSetStrokeColorWithColor(theContext, [UIColor greenColor].CGColor);
CGContextBeginPath(theContext);
CGContextAddPath(theContext, path);
CGContextSetLineWidth(theContext, 3);
CGContextStrokePath(theContext);
CFRelease(path); 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment