html5 canvas 标签,提供了画图功能;
可参考:[url]http://www.w3schools.com/html5/tag_canvas.asp[/url]
简单例子:
可参考:[url]http://www.w3schools.com/html5/tag_canvas.asp[/url]
简单例子:
<!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 onload="init();">
<canvas id="canvas"></canvas>
</body>
</html>