<!DOCTYPE html> <html> <script type="text/javascript"> window.onload = function(){ var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); if(context){ context.lineWith=15; context.strokeStyle="red"; context.moveTo(100,100); context.lineTo(700,700); context.lineTo(100,700); context.lineTo(100,100); context.stroke(); context.fillStyle="rgb(2,100,30)"; context.fill(); }else{ alert('当前浏览器不支持Canvas,请更换浏览器后再试'); } } </script> <body> <canvas id="canvas" width="1024" height="768" style="border:1px solid #aaa;display:block;margin:0 auto;"> 当前浏览器不支持Canvas,请更换浏览器后再试 </canvas> </body> </html>
跌落尘层的王者
2014-10-19
0 回答
举报
0/150
提交
取消