html5 canvas使用

来源:互联网 发布:abb码垛指令编程视频 编辑:程序博客网 时间:2024/05/01 12:29

canvas是HTML5新特性最为霸气的特点,一个画布至于最后的画是什么,就看你的造化了;

1
2
3
4
5
6
7
<canvasid="canvas"></canvas></code>
<scripttype="text/javascript">
var canvas=document.getElementById('canvas');//获取到画布
var ctx=canvas.getContext('2d');//2d
ctx.fillStyle='#FF0000';//填充颜色
ctx.fillRect(0,0,80,100);//画矩形
</script>
除声明外,跑步客文章均为原创,转载请以链接形式标明本文地址

本文地址:  http://www.paobuke.com/buildsite/html5/newtexing/pbk313.html



原创粉丝点击