Paths中的几个重要元素 Points void CGContextMoveToPoint ( CGContextRef c, CGFloat x, CGFloat y ); 指定一个点成为current point Quartz会跟踪current point一般执行完一个相关函数后,curre
分类:
移动开发 时间:
2016-02-21 18:23:51
阅读次数:
201
CGContextRef使用简要教程 Graphics Context是图形上下文,也可以理解为一块画布,我们可以在上面进行绘画操作,绘制完成后,将画布放到我们的view中显示即可,view看作是一个画框. CGContextRef功能强大,我们借助它可以画各种图形。开发过程中灵活运用这些技巧,可以
分类:
其他好文 时间:
2016-02-18 01:13:18
阅读次数:
186
1 - (void)drawRect:(CGRect)rect 2 { 3 // 1.获取上下文 4 CGContextRef ctx = UIGraphicsGetCurrentContext(); 5 6 // 2.创建路径(一个path就代表一条路径) 7 ...
分类:
移动开发 时间:
2016-01-23 13:00:09
阅读次数:
149
1 - (void)drawRect:(CGRect)rect 2 { 3 // Drawing code 4 5 // 画圆, 以便于以后指定可以显示内容范围 6 CGContextRef ctx = UIGraphicsGetCurrentContext();...
分类:
移动开发 时间:
2016-01-23 01:21:09
阅读次数:
234
1 - (void)drawRect:(CGRect)rect 2 { 3 // 获取上下文 4 CGContextRef ctx = UIGraphicsGetCurrentContext(); 5 6 // 保存一份最纯洁的图形上下文 7 // 调用一次该方法...
分类:
移动开发 时间:
2016-01-22 21:45:32
阅读次数:
192
1 // 1.获取图形上下文 2 CGContextRef ctx = UIGraphicsGetCurrentContext(); 3 4 // 2. 绘制三角形 5 // 设置起点 6 CGContextMoveToPoint(ctx, 10...
分类:
移动开发 时间:
2016-01-22 17:56:45
阅读次数:
152
1 // 画圆弧 2 // 1.获取上下文 3 CGContextRef ctx = UIGraphicsGetCurrentContext(); 4 // 2.画圆弧 5 // x/y 圆心 6 // radius 半径 7 // start...
分类:
移动开发 时间:
2016-01-22 17:15:31
阅读次数:
149
// 1.获取上下文 CGContextRef ctx = UIGraphicsGetCurrentContext(); // 2.画饼状图 // 画线 CGContextMoveToPoint(ctx, 100, 100); CGContextAddLineT...
分类:
移动开发 时间:
2016-01-22 17:12:33
阅读次数:
153
-(UIImage*)createImageWithColor: (UIColor*) color{ CGRect rect=CGRectMake(0,0, 1, 1); UIGraphicsBeginImageContext(rect.size); CGContextRef co...
分类:
其他好文 时间:
2016-01-21 18:39:57
阅读次数:
115
(四)内主要讲了绘制状态的保存与恢复本次主要讲述 缩放,旋转,平移等操作5.附加操作 5.1 旋转 TIP: 旋转操作主要是对本次渲染的图层进行旋转,旋转的中心为左上角顶点- (void)drawRect:(CGRect)rect { //获取上下文 CGContextRef ctx = U...
分类:
其他好文 时间:
2016-01-20 11:11:30
阅读次数:
135