public class CGPath extends Object
Constructor and Description |
---|
CGPath()
The default constructor of the CGPath.
|
Modifier and Type | Method and Description |
---|---|
void |
addArc(CGAffineTransform transf,
double x,
double y,
double radius,
double startAngle,
double endAngle,
boolean clockwise)
Add an arc to this path.
|
void |
addArcToPoint(CGAffineTransform transf,
double x1,
double y1,
double x2,
double y2,
double radius)
Add an arc with specific radius and given tangent lines
|
void |
addCurveToPoint(CGAffineTransform transf,
double cp1x,
double cp1y,
double cp2x,
double cp2y,
double x,
double y)
Applies a Bézier curve to this path.
|
void |
addEllipseInRect(CGAffineTransform transf,
CGRect rect)
Add an ellipse to this path
|
void |
addLines(CGAffineTransform transf,
CGPoint... points)
Add a list of lines to the path.
|
void |
addLineToPoint(CGAffineTransform transf,
double x,
double y)
Add a line segment to this path.
|
void |
addPath(CGAffineTransform transf,
CGPath path2)
Add another path to this path
|
void |
addQuadCurveToPoint(CGAffineTransform transf,
double cpx,
double cpy,
double x,
double y)
Applies a quadric Bézier curve to this path.
|
void |
addRect(CGAffineTransform transf,
CGRect rect)
Add a rectangular area to this path
|
void |
addRects(CGAffineTransform transf,
CGRect... rects)
Add a list of rectangles to this path.
|
void |
addRoundedRect(CGAffineTransform transf,
CGRect rect,
double cornerWidth,
double cornerHeight) |
void |
closeSubpath()
Closes a subpath.
|
CGPoint |
getCurrentPoint()
Return the last point of this path
|
void |
moveToPoint(CGAffineTransform transf,
double x,
double y)
Attaches a subpath at the specified location of this path.
|
public CGPoint getCurrentPoint()
public void moveToPoint(CGAffineTransform transf, double x, double y)
transf
- The affine transformation.x
- The x value of the point at which the subpath is attached.y
- The y value of the point at which the subpath is attached.CGAffineTransform
public void addLineToPoint(CGAffineTransform transf, double x, double y)
transf
- The affine transformationx
- The x value of the end point of the line segmenty
- The y value of the end point of the line segmentCGAffineTransform
public void addLines(CGAffineTransform transf, CGPoint... points)
addLineToPoint(CGAffineTransform, double, double)
transf
- The affine transformationpoints
- The list of the lines to add to this pathpublic void addArc(CGAffineTransform transf, double x, double y, double radius, double startAngle, double endAngle, boolean clockwise)
transf
- The affine transformation.x
- The x value of the end point of the curve.y
- The y value of the end point of the curve.radius
- The radius of the arc.startAngle
- The beginning of the angle.endAngle
- The end of the angle.clockwise
- The clockwise rotation of the angle.CGAffineTransform
public void addArcToPoint(CGAffineTransform transf, double x1, double y1, double x2, double y2, double radius)
transf
- The affine transformationx1
- The x value of the point of the 1st tangent liney1
- The y value of the point of the 1st tangent linex2
- The x value of the point of the 2nd tangent liney2
- The y value of the point of the 2nd tangent lineradius
- The radius of the arcpublic void addCurveToPoint(CGAffineTransform transf, double cp1x, double cp1y, double cp2x, double cp2y, double x, double y)
transf
- The affine transformation.cp1x
- The x value of the 1st control point.cp1y
- The y value of the 1st control point.cp2x
- The x value of the 2nd control point.cp2y
- The y value of the 2nd control point.x
- The x value of the end point of the curve.y
- The y value of the end point of the curve.CGAffineTransform
public void addQuadCurveToPoint(CGAffineTransform transf, double cpx, double cpy, double x, double y)
transf
- The affine transformation.cpx
- The x-value control point of the curve.cpy
- The y-value control point of the curve.x
- The x-value end point of the curve.y
- The y-value end point of the curve.CGAffineTransform
public void addRect(CGAffineTransform transf, CGRect rect)
transf
- The affine transformationrect
- the rectangle to add to this pathpublic void addRects(CGAffineTransform transf, CGRect... rects)
addRect(CGAffineTransform, CGRect)
transf
- The affine transformationrects
- The list of rectanglespublic void addRoundedRect(CGAffineTransform transf, CGRect rect, double cornerWidth, double cornerHeight)
transf
- The affine transformationrect
- The rectangle to add to this pathcornerWidth
- The width of the rounded cornercornerHeight
- The hight of the rounded cornerpublic void addEllipseInRect(CGAffineTransform transf, CGRect rect)
transf
- The affine transformationrect
- The bounding box which defines this ellipsepublic void addPath(CGAffineTransform transf, CGPath path2)
transf
- The affine transformationpath2
- The new path to add to this pathpublic void closeSubpath()
Copyright © 2020. All rights reserved.