Skip to content

Instantly share code, notes, and snippets.

@oneup
Created July 8, 2009 17:04
Show Gist options
  • Save oneup/142971 to your computer and use it in GitHub Desktop.
Save oneup/142971 to your computer and use it in GitHub Desktop.
teaches how to draw a circle using iphone sdk quartz stuff
- (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
@azadehbouj
Copy link

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment