Opera Presto offers support for the HTML5 <canvas> element. The <canvas> element enables
a bitmap drawing API in HTML. It can be considered the scripted version of the <img /> element. To draw
a simple green square you would use the following code:

Interfaces

Two interfaces are important for the <canvas> element, and are defined in the following two data tables:

HTMLCanvasElement: This interface is exposed by the element.

CanvasRenderingContext2D: This interface is what is being returned with the getContext("2d")
method call.

HTMLCanvasElement support

Member

Supported

Notes

width

Yes

height

Yes

toDataURL()

Yes

getContext(context)

Yes

Opera supports 2d and opera-2dgame as parameters.

Note: The "opera-2dgame" parameter of the getContext() method is not guaranteed to be supported
in future versions of Opera and should be considered experimental. Similar functionality to what it exposes has been added
to the <canvas> specification based on feedback from Opera, and Opera will add support for those new
methods in due course.