首页 > 移动平台 > 详细

iOS CGContextRef画图时的常用方法

时间:2015-12-04 12:16:25      阅读:386      评论:0      收藏:0      [点我收藏+]

UIView的drawRect方法

CoreGraphics绘图

综述:描述系统会调用UIView的drawRect方法,所以coreGraphics的所有实现代码放在该函数内,setNeedsDisplay是更新整个视图,setNeedsDisplayInRect是更新视图的一个区域。

CGContextRef context = UIGraphicsGetCurrentContext();设置上下文

CGContextMoveToPoint 开始画线

CGContextAddLineToPoint  画直线

 

CGContextAddEllipseInRect 画一椭圆

CGContextSetLineCap 设置线条终点形状

CGContextSetLineDash 画虚线

CGContextAddRect 画一方框

CGContextStrokeRect 指定矩形

CGContextStrokeRectWithWidth 指定矩形线宽度

CGContextStrokeLineSegments 一些直线

 

iOS CGContextRef画图时的常用方法

原文:http://www.cnblogs.com/wmx-rj/p/4998528.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!