javascript getContext() method


  Translation results:

get

英[get] 美[ɡɛt]

vt. Get; catch; persuade; receive (punishment, etc.)

vt.& vi. Arrive, come

vi. Become; start; try to deal with; obtain benefits or wealth

n. Reproduce, cub; profit

Third person singular : gets Present participle: getting Past tense: got Past participle: got gotten

context

## English[ˈkɒntekst] US[ˈkɑ:ntekst]

n.Context; context; background; environment

Plural: contexts

javascript getContext() methodsyntax

Function: Returns an environment for drawing on the canvas.

Syntax: Canvas.getContext(contextID)

Parameters: The parameter contextID specifies the type you want to draw on the canvas . Currently the only legal value is "2d", which specifies 2D drawing and causes this method to return an environment object that exports a 2D drawing API.

Returns: A CanvasRenderingContext2D object, which can be used to draw into the Canvas element.

Description: Returns an environment representing the type of environment used to draw. The intention is to provide different environments for different drawing types (2D, 3D). Currently, the only one supported is "2d", which returns a CanvasRenderingContext2D object that implements most of the methods used by a canvas.

Note: In the future, if the <canvas> tag is extended to support 3D drawing, the getContext() method may allow passing a "3d" string argument.

javascript getContext() methodexample

None yet

Home

Videos

Q&A