问答详情
源自:2-2 绘制直线、多边形和七巧板

为什么我总是导不出第一道线,是代码输错了吗

<body>
<canvas id="canvas"  width="1024" height="768"style="border:1px solid#aaa:display:block:margin:50px auto;">
</canvas>
<script>
window.onload=function(){
 var canvas=document.getElementById ("canvas");
 canvas.width=1024;
 canvas.height=768;
 
 
 var context=canvas.getContext("2d")
 context.moveTo(100,100)
 context.lineTO(700,700)
 context.stroke()
}
</script>
</body>

提问者:玉宇雯华 2016-05-25 20:30

个回答

  • 慕粉1470740819
    2016-08-24 14:59:35

    颜色后面是;

  • CoolHuan
    2016-06-16 09:11:26

    hah

  • 慕粉3194558
    2016-05-25 21:56:04

    lineTo();

    o是小写!!