# Canvas

Start from base library version 2.7.0. Please remaining backward compatible.

Canvas Example, you can use the SelectorQuery Get.

# attribute

# number width

Canvas width

# number height

Canvas height

# method

# RenderingContext Canvas.getContext(string contextType)

This method returns Canvas Drawing context

# Image Canvas.createImage()

Create a picture object. Support in 2D Canvas and WebGL Canvas Under use, But does not support mixing 2D and WebGL The method.

# number Canvas.requestAnimationFrame(function callback)

Executes on the next redraw. Support in 2D Canvas and WebGL Canvas Under use, But does not support mixing 2D and WebGL The method.

# Canvas.cancelAnimationFrame(number requestID)

Cancel by requestAnimationFrame Add an animated frame request to the schedule. Support in 2D Canvas and WebGL Canvas Under use, But does not support mixing 2D and WebGL The method.

# ImageData Canvas.createImageData()

Create a ImageData Object. Support only in 2D Canvas Used in.

# Path2D Canvas.createPath2D(Path2D path)

create Path2D object

# string Canvas.toDataURL(string type, number encoderOptions)

Object that contains a picture presentation data URI . Can be used type Parameter whose type defaults to PNG Format.

# sample code

2D Canvas Example Preview with Developer Tool

WebGL Example Preview with Developer Tool