摘要: 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为顺 阅读全文
posted @ 2013-04-15 01:45 金建彤 阅读(168) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/qiqibo/archive/2012/09/04/2669987.htmlPaths中的几个重要元素Pointsvoid CGContextMoveToPoint ( CGContextRef c, CGFloat x, CGFloat y);指定一个点成为current pointQuartz会跟踪current point一般执行完一个相关函数后,current point都会相应的改变.Lines相关的几个函数void CGContextAddLineToPoint ( CGContextRef c, CGFloat x, CGFloat 阅读全文
posted @ 2013-04-15 01:44 金建彤 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 我知道的实现方法有三种。1、通过image mask来操作,需要添加mask目标图片。2、通过imageview的layer来操作如下代码[cpp] view plaincopyprint?UIImageView*imageView=[[UIImageViewalloc]initWithImage:[UIImageimageNamed:@"oiuyfdsa.png"]];imageView.frame=CGRectMake(20.f,20.f,100.f,100.f);imageView.layer.masksToBounds=YES;imageView.layer.cor 阅读全文
posted @ 2013-04-15 01:43 金建彤 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 0CGContextRef context = UIGraphicsGetCurrentContext(); 设置上下文1 CGContextMoveToPoint 开始画线2 CGContextAddLineToPoint 画直线4 CGContextAddEllipseInRect 画一椭圆4 CGContextSetLineCap 设置线条终点形状4 CGContextSetLineDash 画虚线4 CGContextAddRect 画一方框4 CGContextStrokeRect 指定矩形4 CGContextStrokeRectWithWidth 指定矩形线宽度4 CGConte 阅读全文
posted @ 2013-04-15 01:41 金建彤 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 画虚线需要用到函数:CGContextSetLineDash此函数需要四个参数:context– 这个不用多说phase- 稍后再说lengths– 指明虚线是如何交替绘制,具体看例子count–lengths数组的长度CGContextRefcontext=UIGraphicsGetCurrentContext();CGContextBeginPath(context);CGContextSetLineWidth(context,2.0);CGContextSetStrokeColorWithColor(context,[UIColorwhiteColor].CGColor);floatle 阅读全文
posted @ 2013-04-15 01:39 金建彤 阅读(163) 评论(0) 推荐(0) 编辑