Creates a helper drawing into a canvas context.
The canvas context to draw into.
Clears the whole canvas (unaffected by the current transform).
Strokes a circle.
Center point.
Radius.
Strokes a circle given by center coordinates.
X of the center.
Y of the center.
Radius.
Cloudy edge: semicircular arcs along each edge of the closed polygon, with a diameter of about intensity × 10.
Strokes a line between two points.
Start point.
End point.
Strokes a line between two points given by coordinates.
X of the start point.
Y of the start point.
X of the end point.
Y of the end point.
Strokes a polygon or polyline through the points; does nothing without points.
The vertices.
Optionalclosed: boolean
Whether to close the path back to the first point; defaults to true.
Strokes a rectangle (reversed corners are normalized).
The rectangle.
Fills text at a position.
The text.
X of the text baseline start.
Y of the text baseline.
Optionalfont: Font
Font to use (name and size in pixels); the current context font when omitted.
Measures text.
The text.
Optionalfont: Font
Font to use (name and size in pixels); the current context font when omitted.
Width and height of the text in pixels.
Height in pixels (ascent plus descent).
Width in pixels.
Drawing helpers for custom annotation drawing; they use the current stroke style, fill style and line width of the context.