Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (43 sloc) 1.07 KB
<!DOCTYPE html>
<html>
<head>
<title>HTML5</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8" />
<script src="jq.js"></script>
</head>
<body>
<canvas id="canvas1" style="border:1px solid #333" width="400" height="300">
</canvas>
<script>
var canvas = document.getElementById('canvas1');
var context = canvas.getContext('2d');
//context.translate(100,100)
context.save();
context.translate(130,250);
context.beginPath();
context.moveTo(-25,-50);
context.lineTo(-10,-80);
context.lineTo(-20,-80);
context.lineTo(-5,-110);
context.lineTo(-15,-110);
context.lineTo(0,-140);
context.lineTo(15,-110);
context.lineTo(5,-110);
context.lineTo(20,-80);
context.lineTo(10,-80);
context.lineTo(25,-50);
context.closePath();
context.lineWidth = 4;
context.lineJoin = 'round';
context.strokeStyle = '#663300'
context.fillStyle = "#339900";
context.fill();
context.stroke();
context.fillStyle = '#663300'
context.fillRect(-5,-50,10,50);
context.clearRect()
context.restore();
</script>
</body>
</html>