六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 116|回复: 0

html5 canvas

[复制链接]

升级  80.67%

49

主题

49

主题

49

主题

秀才

Rank: 2

积分
171
 楼主| 发表于 2013-1-24 06:51:47 | 显示全部楼层 |阅读模式
html5 canvas 标签,提供了画图功能;

可参考:http://www.w3schools.com/html5/tag_canvas.asp

简单例子:
<!DOCTYPE HTML><html><head><meta charset="utf-8" /><title>html 5 test</title><script type="text/javascript">function init() {var canvas = document.getElementById("canvas");if (canvas.getContext) {  var ctx = canvas.getContext("2d");  ctx.fillStyle = "rgb(200,0,0)";  ctx.fillRect (10, 10, 55, 50);  ctx.fillStyle = "rgba(0, 0, 200, 0.5)";  ctx.fillRect (30, 30, 55, 50);}}</script></head><body ><canvas id="canvas"></canvas></body></html>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表