Methods
-
(static) createCanvas(container, idCanvas, width, height, zIndex, borderWidth, borderStyle, borderColor) → {HTMLCanvasElement}
-
Create and optionally insert a Canvas element into the given DOM container element.
Parameters:
Name Type Description containerElement | null the Element into which to insert the created Canvas or null to create a stand-alone canvas
idCanvasstring the desired id to use for the <canvas> within the DOM
widthnumber the width of the Canvas in pixels
heightnumber the height of the Canvas in pixels
zIndexnumber the zIndex of the Canvas
borderWidthstring width of the border, e.g. "2px"
borderStylestring style of the border, e.g. "solid", "dotted"
borderColorstring color of the border, e.g. "#100381"
- See:
Returns:
the created Canvas
- Type
- HTMLCanvasElement
-
(static) getContext2D(canvas) → {CanvasRenderingContext2D|null}
-
Get the 2D rendering context for a given Canvas (with imageSmoothingEnabled = false).
Parameters:
Name Type Description canvasstring | HTMLCanvasElement a DOM id of a <canvas> or a HTMLCanvasElement
Returns:
a 2D rendering context or null if none is available
- Type
- CanvasRenderingContext2D | null
-
(static) getContextGL(canvas, glContextAttributesopt) → {WebGLRenderingContext|null}
-
Get the webgl rendering context for a given Canvas.
Parameters:
Name Type Attributes Description canvasstring | HTMLCanvasElement a DOM id of a <canvas> or a HTMLCanvasElement
glContextAttributesWebGLContextAttributes <optional>
Returns:
a webgl rendering context or null if none is available
- Type
- WebGLRenderingContext | null