Interface

HTMLCanvasElement

HTMLCanvasElement

Provides properties and methods for manipulating the layout and presentation of elements. The HTMLCanvasElement interface also inherits the properties and methods of the HTMLElement interface.

View Source js/lib.dom.d.ts, line 2223

Members

CanvasRenderingContext2D | null

# getContext

Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.

View Source js/lib.dom.d.ts, line 2236

number

# height

Gets or sets the height of a canvas element on a document.

View Source js/lib.dom.d.ts, line 2226

string

# toDataURL

Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.

View Source js/lib.dom.d.ts, line 2242

number

# width

Gets or sets the width of a canvas element on a document.

View Source js/lib.dom.d.ts, line 2231