JS 文件通过哪个命令获取canvas对象()
A: getWebGLContext(canvas)
B: document.getElementById(“example”)
C: canvas.getContext(2d)
D:
A: getWebGLContext(canvas)
B: document.getElementById(“example”)
C: canvas.getContext(2d)
D:
举一反三
- JS 文件通过哪个命令获取canvas对象? A: getWebGLContext(canvas) B: document.getElementById("example") C: canvas.getContext(2d) D: <canvas id="webgl" width="400" height="400"></canvas>
- canvas中二维绘图环境对象获取的语句是哪项?假设canvas为获取的canvas对象名。 A: var ctx=canvas.getContext("2d"); B: var canvas=document.getElementById("myCanvas"); C: var ctx=canvas.getContext("WebGL"); D: var ctx=canvas.getElementById("2d");
- 1.2.1 JS 文件通过哪个命令获取canvas对象?
- canvas绘图是借助于javascript脚本通过( )方法进行图像绘制 A: getElementById() B: getContext("2d") C: fillRect( D: strokeRect()
- 画布(如下代码)创建后,怎样获取? [canvas id="myCanvas" width="200" height="100"] </canvas A: var canvas=document.getElementById('myCanvas'); B: var canvas=document.getElementsByName('myCanvas'); C: var canvas=document.getElementsById('myCanvas'); D: var canvas=document.getElementById('mycanvas');