<!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: 20px auto;"><!-- 默认宽300像素,高150像素 --> 当前浏览器不支持canvas,请切换浏览器后再试;</canvas> <script type="text/javascript"> window.onload=function(){ var canvas=document.getElementById('canvas'); var context=canvas.getContext("2d"); canvas.width=1024; canvas.height=768; context.moveTo(100,100); context.lineTo(700,700); context.lineWidth=5px; context.strokeStyle="#005588"; context.stroke(); } </script></body></html>
1 回答
- 1 回答
- 0 关注
- 1332 浏览
添加回答
举报
0/150
提交
取消