日期:2014-05-16 浏览次数:20503 次
<canvas id="myCanvas" width="1000" height="800"></canvas>
<script>
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
context.beginPath();
context.lineWidth="2"
context.strokeStyle="black"
context.moveTo(10, 10);
context.lineTo(100, 100);
context.stroke();
</script>