CGContext】的更多相关文章

/* *设置虚线 *param context CGContext *param context CGContext *param lineDashLengths 如: const CGFloat lineDashLengths[2] = {2., 50. }; 2 是没接虚线的长度2 和间隔50 *returns */ void setXuXian(CGContextRef context,const CGFloat lineDashLengths[],CGFloat width){ CGCo…
周刊 更多 登录   IOS开发之——绘图(CGContext) 时间 2014-04-21 09:17:43 CSDN博客 原文  http://blog.csdn.net/zhenyu5211314/article/details/24230581 0    CGContextRef context = UIGraphicsGetCurrentCont ext(); 设置上下文 1 CGContextMoveToPoint 开始画线 2 CGContextAddLineToPoint 画直线…
CGContext又叫图形上下文,相当于一块画布,以堆栈形式存放,只有在当前context上绘图才有效.iOS有分多种图形上下文,其中UIView自带提供的在drawRect:方法中通过UIGraphicsGetCurrentContext获取,还有专门为图片处理的context,UIGraphicsBeginImageContext函数生成,还有pdf的context等等. 1.一共有3种使用context的场景,其中每种场景都有2种方法绘图 场景1: //通过UIView的子类的drawRe…
CGContext又叫图形上下文,相当于一块画布,以堆栈形式存放,只有在当前 context上绘图才有效.iOS有分多种图形上下文,其中UIView自带提供的在drawRect:方法中通过 UIGraphicsGetCurrentContext获取,还有专门为图片处理的context,UIGraphicsBeginImageContext函数生成,还有pdf的context等等. 1.一共有3种使用context的场景,其中每种场景都有2种方法绘图 场景1: //通过UIView的子类的draw…
0 CGContextRef context = UIGraphicsGetCurrentContext(); 设置上下文 1 CGContextMoveToPoint 开始画线 2 CGContextAddLineToPoint 画直线 4 CGContextAddEllipseInRect 画一椭圆 4 CGContextSetLineCap 设置线条终点形状 4 CGContextSetLineDash 画虚线 4 CGContextAddRect 画一方框 4 CGContextStro…
/* CoreGraphics - CGContext.h Copyright (c) 2000-2012 Apple Inc. All rights reserved. */ #ifndef CGCONTEXT_H_ #define CGCONTEXT_H_ #include <CoreFoundation/CFBase.h> #include <CoreFoundation/CFAvailability.h> #include <stdint.h> typedef…
-(void)drawRect:(CGRect)rect{ CGFloat w = self.bounds.size.width; CGFloat h = self.bounds.size.height; //数据数组 NSArray *array = @[@1,@2,@3,@4,@5,@6,@7,@8,@9,@10]; //颜色数组 NSArray *colorArray = @[[UIColor redColor], [UIColor greenColor], [UIColor yellow…
Managing Graphics Contexts:管理图形上下文 CGContextFlush // 强制立即渲染未执行在一个窗口上下文上的绘图操作到目标设备.系统会在合适的时机自动调用此函数,手动调用可能会在表现上引起相反的作用,所以一般条件下,你不需要调用此函数. CGContextGetTypeID//返回Quartz图形上下文的类型标识符. CGContextRelease // CG不支持ARC需要手动释放,相对应的还有CGColorRelease,CGColorSpaceRele…
0 CGContextRef context = UIGraphicsGetCurrentContext(); 设置上下文 1 CGContextMoveToPoint 开始画线 2 CGContextAddLineToPoint 画直线 4 CGContextAddEllipseInRect 画一椭圆 4 CGContextSetLineCap 设置线条终点形状 4 CGContextSetLineDash 画虚线 4 CGContextAddRect 画一方框 4 CGContextStro…
0  CGContextRef context = UIGraphicsGetCurrentContext(); 设置上下文 
1 CGContextMoveToPoint 开始画线
 2 CGContextAddLineToPoint 画直线

 3 CGContextAddEllipseInRect 画一椭圆 
4 CGContextSetLineCap 设置线条终点形状 
5 CGContextSetLineDash 画虚线 
6 CGContextAddRect 画一方框 
7 CGCo…