慕粉1470740819
2016-08-24 15:01
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>测试</title>
</head>
<body>
<canvas id="canvas" width = 1024 height = 768 style="border:1px solid #aaa;display:block;margin:50px auto;"></canvas>
<script>
window.onload = function(){
var canvas = document.getElementById("canvas");
canvas.width = 1024;
canvas.height = 768;
var context = canvas,getconText("2d")
//使用context绘制
context.moveTo(100,100)
context.lineTo(700,700)
context.stroke()
}
</script>
</body>
</html>
var context = canvas,getconText("2d")
改为:
var context = canvas.getConText("2d")
炫丽的倒计时效果Canvas绘图与动画基础
96746 学习 · 1000 问题
相似问题