IOS_CGContextAddArcToPoint与CGContextAddArc
来源:互联网 发布:淘宝如何代运营 编辑:程序博客网 时间:2024/05/29 03:40
这两个函数是绘制圆弧的函数。第一个函数比较好理解,第二个函数让我在纸上画了半天才搞明白,把我的理解给大家分享下。
void
CGContextRef不解释了,x,y为圆点坐标,startAngle为开始的弧度,endAngle为
以下是示例代码。
CGContextBeginPath(context);
CGContextSetRGBStrokeCol
CGContextAddArc(context, 100, 100, 50, 180* PI/ 180, 270* PI/ 180, 0);
void
这个函数就比较难理解了,首先使用该函数绘制圆弧前,首先要确定一个start point.
CGContextMoveToPoint(context, 100, 100);
然后设置CGContextAddArcToPoint(context, 50, 100, 50, 150, 50);
这里是从起始点100,100开始到第一个点50,100画一条线段,然后再从第一个点50,100到第二点150,50画另一条线段,然后设置半径为50.通过相交的两条线段和半径就可以确定圆弧了。
示例代码如下:
CGContextBeginPath(context);
CGContextSetRGBStrokeCol
CGContextMoveToPoint(context, 100, 100);
CGContextAddArcToPoint(context, 50, 100, 50, 150, 50);
CGContextStrokePath(context);
注意:Path被绘制后,当前点的坐标更改为150,50
- IOS_CGContextAddArcToPoint与CGContextAddArc
- CGContextAddArcToPoint与CGContextAddArc
- CGContextAddArcToPoint与CGContextAddArc
- CGContextAddArc
- CGContextAddArc
- CGContextAddArc与CGContextAddArcToPoint参数解析
- CGContextAddArc的使用
- CGContextAddArc 和 CGContextAddArcToPoint 区别
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArc的使用
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- CGContextAddArcToPoint和CGContextAddArc
- iOS: CGContext的函数CGContextAddArc
- iOS-CGContextAddArc各参数说明
- image 圆角
- 随感
- 练习20:函数和文件操作的基本方法
- google官方上拉刷新
- JSR-303验证框架在Springmvc中的应用
- IOS_CGContextAddArcToPoint与CGContextAddArc
- win8下cocos2d-x 3.0+vs2012环境配置及项目创建
- maven+eclipse+tomcat配置过程记录
- java8中compile方法的源码
- 武大打铁之后
- java可重入锁ReentrantLock原理
- 快速幂模m算法
- Android 图片如何高效加载与缓存 (4.5) —— 缩略图生成的优化
- 循环队列