Created
July 8, 2009 17:04
-
-
Save oneup/142971 to your computer and use it in GitHub Desktop.
teaches how to draw a circle using iphone sdk quartz stuff
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)makeCircleAt:(CGPoint)center withDiameter:(float)diameter withColor:(int)myColor | |
{ | |
float radius = diameter * 0.5; | |
CGRect myOval = {center.x - radius, center.y - radius, diameter, diameter}; | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0); | |
CGContextAddEllipseInRect(context, myOval); | |
CGContextFillPath(context); | |
} | |
// via http://alanduncan.net/index.php?q=node/4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would you please explain how to use it in a program thanks,
For exemple by calling this method from the other part of the program ?
Thanks,