CGContextAddArc
来源:互联网 发布:淘宝网打底衫女 编辑:程序博客网 时间:2024/05/17 03:38
http://differentisnotdifferent.diandian.com/post/2012-07-30/40032320467
这个函数让我在纸上画了半天才搞明白,把我的理解给大家分享下。
void CGContextAddArc(CGContextRef c, CGFloat x, CGFloat y, CGFloat radius, CGFloat startAngle, CGFloat endAngle, int clockwise)
CGContextRef不解释了,x,y为圆点坐标,startAngle为开始的弧度,endAngle为 结束的弧度,clockwise 0为顺时针,1为逆时针。
CGContextAddArc(context, 160, 200, 100, 0, 45*(M_PI/180), 0);
所以对上面这对代码的解释是这样的:
1)startAngle为0,绿色箭头的地方。
2)endAngle为45,黄色箭头的地方。
3)clockwise为0,按照红色箭头往下绘制图形。
4)所以效果就是红色的扇形。
补充:如果clockwise为1,则是蓝色部分区域。
0 0
- CGContextAddArc
- CGContextAddArc
- CGContextAddArc的使用
- CGContextAddArcToPoint与CGContextAddArc
- CGContextAddArcToPoint与CGContextAddArc
- CGContextAddArc 和 CGContextAddArcToPoint 区别
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArc的使用
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- IOS_CGContextAddArcToPoint与CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- iOS: CGContext的函数CGContextAddArc
- CGContextAddArc与CGContextAddArcToPoint参数解析
- iOS-CGContextAddArc各参数说明
- [ios]kvo 【转】
- iOS 使用Quartz 2D画虚线 【转】
- CGContex
- ios Image裁剪成圆形的方法 [转]
- IOS(CGContent画曲线)
- CGContextAddArc
- [ios] NSSet,NSMutableSet[zhuan]
- [ios]NSArray中的数据进行排序 ---- sortedArrayUsingDescriptors
- [ios]精通UIPasteboard 粘贴板 【转】
- [ios]iOS开发之self.abc = nil与[_abc release]的区别【转】
- [ios]检查自己写的程序有没有内存泄露【转】
- [ios] UIWebView的离线缓存【转】
- [ios2]SHA1,MD5加密
- [ios] NSData