canvas 总结
canvas 制图
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>JS Bin</title>
<style>
#canvas {
width: 300px;
height: 600px;
border: 1px solid green;
}
</style>
</head>
<body>
<canvas id="canvas" width="300" height="300"></canvas>
<script>
var c = document.getElementById('canvas')
var ctx = c.getContext('2d')
ctx.moveTo(0, 0)
ctx.lineTo(300, 300)
ctx.stroke()
</script>
</body>
</html>Last updated