beginPath()没有作用??
window.onload=function(){
var canvas=document.getElementById("canvas");
//宽高
canvas.width=800;
canvas.height=800;
var context=canvas.getContext("2d");
context.lineWidth=10;//直线宽度
//context.beginPath();
context.moveTo(100,200);//直线起点
context.lineTo(300,400);//直线终点
context.lineTo(100,600);//直线终点
context.strokeStyle="red";//绘制直线的颜色
context.stroke();//绘制
context.beginPath();
context.moveTo(300,200);//直线起点
context.lineTo(500,400);//直线终点
context.lineTo(300,600);//直线终点
context.strokeStyle="green";//绘制直线的颜色
context.stroke();//绘制
context.beginPath();
context.moveTo(500,200);//直线起点
context.lineTo(700,400);//直线终点
context.lineTo(500,600);//直线终点
context.strokeStyle="#058";//绘制直线的颜色
context.stroke();//绘制