<html>
<head>
<title>ExplorerCanvas Example 1</title>
<!--[if IE]><script type="text/javascript" src="excanvas_r3/excanvas.js"></script><![endif]-->
<style>
body {
background-color:white;
margin:50px;
text-align:center;
}
canvas {
border:1px solid #444;
}
</style>
<script type="text/javascript">
function load() {
canvas = document.getElementById("cv");
ctx = canvas.getContext("2d");
ctx.save();
ctx.translate(100,100);
ctx.beginPath();
ctx.moveTo(0,0);
ctx.lineTo(10,0);
ctx.lineTo(10,-10);
ctx.lineTo(20,-10);
ctx.lineTo(10,-20);
ctx.lineTo(20,-20);
ctx.lineTo(10,-30);
ctx.lineTo(20,-30);
ctx.lineTo(0,-50);
ctx.closePath();
ctx.lineWidth =4;
ctx.lineJoin = 'round';
ctx.strokeStyle = '#663300';
ctx.stroke();
ctx.fillStyle = '#339900';
ctx.fill();
ctx.restore();
};
</script>
</head>
<body onload="load();">
<canvas id="cv" width="400" height="300"></canvas>
</body>
</html>
效果图: