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.
CanvasRenderingContext2D retVal = object.getContext(contextId, contextAttribute);
- contextId [in]
The identifier (ID) of the type of canvas to create.
Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using
IE11 also supports 3-D or WebGL context using
- contextAttribute [in, optional]
- The canvas element, Section 4.8.11
The IHTMLCanvasElement::getContext method returns NULL if the contextId value is not supported.
Note A canvas object only supports one context. Additional calls to IHTMLCanvasElement::getContext this object return the same context.
Note If you are developing on an intranet and have rendering issues for HTML5, you can add a "meta http-equiv-'X-UA-Compatible' content= edge" to the <head> block of a webpage to force Windows Internet Explorer to use the latest standards. You shouldn't use this meta-tag for production webpages. For more information about document compatibility, see Defining Document Compatibility.