Quartz2D简单绘制之贝塞尔曲线

View Code
// 画贝塞尔曲线
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBStrokeColor(context, 255.0f, 255.0f, 255.0f, 1.0f);
CGContextMoveToPoint(context, 100.0f, 100.0f); // 端点一
CGContextSetLineWidth(context, 2.0f);
// (200, 150) 控制点一 (50, 200) 控制点二 (100,300) 端点二
//CGContextAddCurveToPoint(context, 200, 150, 50, 200, 100, 300); // 三次塞尔曲线
// (200,100) 控制点一 (100,300) 端点二
CGContextAddQuadCurveToPoint(context, 200, 100, 100, 300); // 二次塞尔曲线
CGContextStrokePath(context);



相关文章:

  • 2021-09-28
  • 2022-01-24
  • 2021-09-06
  • 2022-01-28
  • 2021-09-16
  • 2022-12-23
  • 2021-10-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-10-08
  • 2021-05-03
相关资源
相似解决方案