Drawing provides a set of drawing methods used by Path and custom shape classes.
Drawing has the following implementations based on browser capability.
DrawingclearClears the path.
closePathEnds a fill and stroke
curveTocp1x
cp1y
cp2x
cp2y
x
y
Draws a bezier curve.
drawCirclex
y
r
Draws a circle.
drawDiamondx
y
width
height
Draws a diamond.
drawEllipsex
y
w
h
Draws an ellipse.
drawRectx
y
w
h
Draws a rectangle.
drawRoundRectx
y
w
h
ew
eh
Draws a rectangle with rounded corners.
drawWedgex
y
startAngle
arc
radius
yRadius
Draws a wedge.
x
Number
x-coordinate of the wedge's center point
y
Number
y-coordinate of the wedge's center point
startAngle
Number
starting angle in degrees
arc
Number
sweep of the wedge. Negative values draw clockwise.
radius
Number
radius of wedge. If [optional] yRadius is defined, then radius is the x radius.
yRadius
Number
[optional] y radius for wedge.
endCompletes a drawing operation.
lineTopoint1
point2
Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates.
moveTox
y
Moves the current drawing position to specified x and y coordinates.
quadraticCurveTocpx
cpy
x
y
Draws a quadratic bezier curve.
relativeLineTopoint1
point2
Draws a line segment using the current line style from the current drawing position to the relative x and y coordinates.