Created
September 14, 2012 01:45
-
-
Save taberh/3719322 to your computer and use it in GitHub Desktop.
Use Core Graphics draw triangle
This file contains 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
void drawTriangle(CGContextRef context, CGPoint startPoint, CGPoint secondPoint, CGPoint lastPoint) | |
{ | |
CGContextSaveGState(context); | |
CGContextMoveToPoint(context, startPoint.x, startPoint.y); | |
CGContextAddLineToPoint(context, secondPoint.x, secondPoint.y); | |
CGContextAddLineToPoint(context, lastPoint.x, lastPoint.y); | |
CGContextClosePath(context); | |
CGContextFillPath(context); | |
CGContextRestoreGState(context); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment