ShapePath

ShapePath class

Represents a creation path consisting of a series of moves, lines and curves that when combined will form a geometric shape.

class ShapePath;

Constructors

NameDescription
constructor()Initializes a new instance of the ShapePath class.

Methods

MethodDescription
getPathSegementList()Gets ShapeSegmentPathCollection list
moveTo(number, number)Starts a new figure from the specified point without closing the current figure. All subsequent points added to the path are added to this new figure.
lineTo(number, number)Appends a line segment to the current figure. The starting point is the end point of the current figure.
cubicBezierTo(number, number, number, number, number, number)Appends a cubic Bézier curve to the current figure. The starting point is the end point of the current figure.
arcTo(number, number, number, number)Appends an elliptical arc to the current figure. The starting point is the end point of the current figure.
close()Closes the current figure and starts a new figure. If the current figure contains a sequence of connected lines and curves, the method closes the loop by connecting a line from the endpoint to the starting point.
isNull()Checks whether the implementation object is null.

constructor()

Initializes a new instance of the ShapePath class.

constructor();

getPathSegementList()

Gets ShapeSegmentPathCollection list

getPathSegementList() : ShapeSegmentPathCollection;

Returns

ShapeSegmentPathCollection

moveTo(number, number)

Starts a new figure from the specified point without closing the current figure. All subsequent points added to the path are added to this new figure.

moveTo(x: number, y: number) : void;

Parameters:

ParameterTypeDescription
xnumberThe x-coordinate of the starting point of the figure.
ynumberThe y-coordinate of the starting point of the figure.

lineTo(number, number)

Appends a line segment to the current figure. The starting point is the end point of the current figure.

lineTo(x: number, y: number) : void;

Parameters:

ParameterTypeDescription
xnumberThe x-coordinate of the endpoint of the line segment.
ynumberThe y-coordinate of the endpoint of the line segment.

cubicBezierTo(number, number, number, number, number, number)

Appends a cubic Bézier curve to the current figure. The starting point is the end point of the current figure.

cubicBezierTo(ctrX1: number, ctrY1: number, ctrX2: number, ctrY2: number, endX: number, endY: number) : void;

Parameters:

ParameterTypeDescription
ctrX1numberThe x-coordinate of the first control point for the curve.
ctrY1numberThe y-coordinate of the first control point for the curve.
ctrX2numberThe x-coordinate of the second control point for the curve.
ctrY2numberThe y-coordinate of the second control point for the curve.
endXnumberThe x-coordinate of the endpoint of the curve.
endYnumberThe y-coordinate of the endpoint of the curve.

arcTo(number, number, number, number)

Appends an elliptical arc to the current figure. The starting point is the end point of the current figure.

arcTo(wR: number, hR: number, stAng: number, swAng: number) : void;

Parameters:

ParameterTypeDescription
wRnumberThe half-width of the rectangular area of ​​the ellipse that draws the arc.
hRnumberThe half-height of the rectangular area of ​​the ellipse that draws the arc.
stAngnumberThe starting angle of the arc, measured in degrees clockwise from the x-axis.
swAngnumberThe angle between startAngle and the end of the arc.

close()

Closes the current figure and starts a new figure. If the current figure contains a sequence of connected lines and curves, the method closes the loop by connecting a line from the endpoint to the starting point.

close() : void;

isNull()

Checks whether the implementation object is null.

isNull() : boolean;