码迷,mamicode.com
首页 > Windows程序 > 详细

Drawing a circle

时间:2015-07-15 10:42:21      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:

- (void)drawRect:(CGRect)rect {

CGFloat lineWidth = 2;
CGRect borderRect = CGRectMake(self.frame.size.width/2, self.frame.size.height - 20, 10.0, 10.0);
borderRect = CGRectInset(borderRect, lineWidth * 0.5, lineWidth * 0.5);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBStrokeColor(context, 85.0/255.0, 143.0/255.0, 220.0/255.0, 1.0);
CGContextSetRGBFillColor(context, 5.0/255.0, 43.0/255.0, 20.0/255.0, 1.0);
CGContextSetLineWidth(context, 2.0);
CGContextFillEllipseInRect (context, borderRect);
CGContextStrokeEllipseInRect(context, borderRect);
CGContextFillPath(context);
}

Drawing a circle

标签:

原文地址:http://www.cnblogs.com/qike/p/4647413.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!