CGContextRef c = UIGraphicsGetCurrentCont
CGContextBeginPath CGContextMoveToPoint. After you establish the first point, you can add lines, arcs, and curves to the path, keeping in mind the following:
Before you begin a new path, call the function
CGContextBeginPath.Lines, arcs, and curves are drawn starting at the current point. An empty path has no current point; you must call
CGContextMoveToPointto set the starting point for the first subpath or call a convenience function that implicitly does this for you. When you want to close the current subpath within a path, call the function
CGContextClosePathto connect a segment to the starting point of the subpath. Subsequent path calls begin a new subpath, even if you do not explicitly set a new starting point. When you draw arcs, Quartz draws a line between the current point and the starting point of the arc.
Quartz routines that add ellipses and rectangles add a new closed subpath to the path.
You must call a painting function to fill or stroke the path because creating a path does not draw the path. See
“Painting a Path” for detailed information.
CGContextRef c = UIGraphicsGetCurrentCont
CGContextBeginPath CGContextMoveToPoint. After you establish the first point, you can add lines, arcs, and curves to the path, keeping in mind the following:
Before you begin a new path, call the function
CGContextBeginPath.Lines, arcs, and curves are drawn starting at the current point. An empty path has no current point; you must call
CGContextMoveToPointto set the starting point for the first subpath or call a convenience function that implicitly does this for you. When you want to close the current subpath within a path, call the function
CGContextClosePathto connect a segment to the starting point of the subpath. Subsequent path calls begin a new subpath, even if you do not explicitly set a new starting point. When you draw arcs, Quartz draws a line between the current point and the starting point of the arc.
Quartz routines that add ellipses and rectangles add a new closed subpath to the path.
You must call a painting function to fill or stroke the path because creating a path does not draw the path. See
“Painting a Path” for detailed information.

本文介绍了iOS中的绘图基础,包括如何获取绘图上下文、如何使用Quartz开始和构建路径等核心概念。通过调用特定的方法可以实现绘制线条、闭合路径等功能。
2798

被折叠的 条评论
为什么被折叠?



