Created
April 9, 2015 21:31
-
-
Save rraallvv/7e1e9e47ac31ed46bd84 to your computer and use it in GitHub Desktop.
draw path with points in cocoa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGPoint points[num]; | |
CGContextRef ctx = [[NSGraphicsContext currentContext] graphicsPort]; | |
CGMutablePathRef path = CGPathCreateMutable(); | |
CGPathAddLines(path, NULL, points, num); | |
if (closePath) CGPathCloseSubpath(path); | |
CGContextAddPath(ctx,path); | |
CGContextStrokePath(ctx); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment