canvas 画线

var c = document.getElementById("myCanvas");//注意有双引号

var context = c.getContext("2d");

context.moveTo(0,0);

context.lineTo(200,100);

context.stroke();

你可能感兴趣的:(canvas 画线)