目录
Canvas
绘制一个画布:
<canvas id="Canvas1" width="200" height="100" class="legacy-canvas-border">
在画布中创建线条:
<script>
var canvas = document.getElementById("Canvas1");
var ctx = canvas.getContext("2d");
ctx.moveTo(0,0);
ctx.lineTo(200,100);
ctx.stroke();
ctx.beginPath();
ctx.arc(95,50,50,0,2*Math.PI);
ctx.stroke();
ctx.beginPath();
ctx.arc(150,50,50,0,2*Math.PI);
ctx.stroke();
</script>