CGContextRef context = ();
//设置起始点
CGContextMoveToPoint (context, 160, 100);
CGContextAddLineToPoint (context, 100, 180);
CGContextAddLineToPoint (context, 160, 180);
// 设置边界
[[UIColor blackColor] setStroke];
//填充颜色
[[UIColor redColor] setFill];
//绘制路径
CGContextDrawPath(context, kCGPathFillStroke);
//获取上下文
CGContextRef context = UIGraphicsGetCurrentContext();
CGRect rect = CGRectMake(50, 200, 200, 200);
//是否有边框
// UIRectFrame(rect);
//矩形中添加一个椭圆
CGContextAddEllipseInRect(context, rect);
[[UIColor greenColor] setStroke];
//设置绿色背景
[[UIColor greenColor] setFill];
// 3. 绘制路径
CGContextDrawPath(context, kCGPathFillStroke);
Created
February 9, 2015 04:14
-
-
Save ldong/a6e10905043ea3abaeb3 to your computer and use it in GitHub Desktop.
Quartz 2D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment