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);
-
-
Save fhefh2015/bf4a53b56a74f17f37d9 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