Home > Web Front-end > H5 Tutorial > HTML5 obtains the drawing environment by calling the getContext() method of the canvas object_html5 tutorial skills

HTML5 obtains the drawing environment by calling the getContext() method of the canvas object_html5 tutorial skills

WBOY
Release: 2016-05-16 15:47:26
Original
2044 people have browsed it

The most basic drawing environment we use is drawing in canvas, and the drawing environment is obtained by calling the getContext() method of the canvas object. The getContext() method requires only one parameter: the type of drawing environment. In the game we use a 2D type drawing environment.

Get the canvas drawing environment

Copy the code
The code is as follows:






HTML5
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template