Section 25.7. Canvas.getContext( ): return a context for drawing on the canvas


25.7. Canvas.getContext( ): return a context for drawing on the canvas

25.7.1. Synopsis

 CanvasRenderingContext2D getContext(String contextID) 

25.7.1.1. Arguments

contextID

This argument specifies the type of drawing you want to do with the canvas. Currently the only valid value is "2d", which specifies two-dimensional drawing and causes this method to return a context object that exports a 2-D drawing API.

25.7.1.2. Returns

A CanvasRenderingContext2D object with which you can draw into the Canvas element.

25.7.2. Description

Returns a context representing the type of context to use in drawing. The intent is to provide different contexts for different drawing types (2-D, 3-D). Currently, the only one supported is "2d", which returns a CanvasRenderingContext2D object that implements most of the methods used by a canvas.

25.7.3. See Also

CanvasRenderingContext2D




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net