Paints data from the given ImageData object onto the bitmap at coordinates (x, y).

quadraticCurveTo(cpx, cpy, x, y)

Parameters:

cpx: number

the x axis of the coordinate for the control point.

cpy: number

the y axis of the coordinate for the control point.

x: number

the x axis of the coordinate for the end point.

y: number

the y axis of the coordinate for the end point.

Adds a quadratic Bézier curve to the path. The starting point is the last point in the current path.

rect(x, y, width, height)

Parameters:

x: number

the x axis of the rectangle’s upper-left corner.

y: number

the y axis of the rectangle’s upper-left corner.

width: number

the rectangle’s width.

height: number

the rectangles height.

Creates a path for a rectangle with the top-left corner at (x, y)

restore()

Restores the most recently saved canvas state by popping the top entry in the drawing state stack.

rotate(angle)

Parameters:

angle: number

The angle to rotate clockwise in radians.

Adds a rotation to the transformation matrix.

save()

Saves the entire state of the canvas by pushing the current state onto a stack.

scale(x, y)

Parameters:

x: number

scaling factor in the horizontal direction.

y: number

scaling factor in the vertical direction.

Adds a scaling transformation to the canvas units by x horizontally and by y vertically.

setTransform(a, b, c, d, e, f)

Parameters:

a: number

horizontal scaling.

b: number

horizontal skewing.

c: number

vertical skewing.

d: number

vertical scaling.

e: number

horizontal moving.

f: number

vertical moving.

resets (overrides) the current transformation to the identity matrix and then invokes a transformation described by the arguments of this method. The matrix has the following format:
[[a, c, e],
[b, d, f],
[0, 0, 1]]

stroke()

Strokes the current path with the current stroke style.

strokeRect(x, y, width, height)

Parameters:

x: number

the x axis of the rectangle’s upper-left corner.

y: number

the y axis of the rectangle’s upper-left corner.

width: number

the rectangle’s width.

height: number

the rectangles height.

draws the outline of a rectangle at (x, y) position whose size is determined by width and height using the current stroke style.

strokeText(text, x, y)

Parameters:

text: string

the text to render.

x: number

the x axis of the coordinate for the text starting point.

y: number

the y axis of the coordinate for the text starting point.

Strokes a given text at the given (x, y) position using the current textAlign and textBaseline values.

transform(a, b, c, d, e, f)

Parameters:

a: number

horizontal scaling.

b: number

horizontal skewing.

c: number

vertical skewing.

d: number

vertical scaling.

e: number

horizontal moving.

f: number

vertical moving.

Multiplies the current transformation with the matrix described by the arguments of this method. The matrix has the following format:
[[a, c, e],
[b, d, f],
[0, 0, 1]]

translate(x, y)

Parameters:

x: number

the distance to move in the horizontal direction.

y: number

the distance to move in the vertical direction.

Adds a translation transformation by moving the canvas and its origin x horizontally and y vertically on the grid.