CGContextAddArc的使用
来源:互联网 发布:淘宝店铺关联怎么弄 编辑:程序博客网 时间:2024/06/06 13:58
CGContextAddArc的使用
这个函数让我在纸上画了半天才搞明白,把我的理解给大家分享下。
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,则是蓝色部分区域。
不知道这样说明是否清楚,如果还是不清楚私信我吧。
本文转载自:http://differentisnotdifferent.diandian.com/post/2012-07-30/40032320467
0 0
- CGContextAddArc的使用
- CGContextAddArc的使用
- CGContextAddArcToPoint和CGContextAddArc的绘图使用
- UIGraphicsGetCurrentContext 和CGBitmapContextCreate 使用CGContextAddArc的奇怪处
- CGContextAddArc
- CGContextAddArc
- iOS: CGContext的函数CGContextAddArc
- iphone上如何绘制饼图(使用CGContextAddArc)(原创)
- CGContextAddArcToPoint与CGContextAddArc
- CGContextAddArcToPoint与CGContextAddArc
- CGContextAddArc 和 CGContextAddArcToPoint 区别
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- IOS_CGContextAddArcToPoint与CGContextAddArc
- 关于box-shaddow 和gradient,颜色rgba的表示方法
- 微软Xbox部分主管称公司不会卖掉Xbox部分
- android适配各种分辨率的问题
- history相关命令详解
- Git学习系列(六)——Git 少用 Pull 多用 Fetch 和 Merge
- CGContextAddArc的使用
- mac 显示隐藏文件
- wget 命令用法详解
- C++中关于浅拷贝及深拷贝的区别
- 测试blog
- ayit See LCS again
- 如何快速拥有排名
- viewpager setOffscreenPageLimit方法
- Base架构设计