<html>
<head>
<script type="application/javascript">
function init() {
var canvas = document.getElementById("canvas");
if (canvas.getContext)
{
var ctx = canvas.getContext("2d");
// Let's keep the lineWidth high so that the difference in lineJoin options is noticeable
ctx.lineWidth=10.0;
ctx.lineCap="round";
// Feel free to try the other options for lineJoin viz., round and bevel
ctx.lineJoin = "miter";
// Draw two line in such a way that one line starts where the other ends.
ctx.moveTo(150, 100);
ctx.lineTo(200, 40);
ctx.lineTo(250, 100);
ctx.stroke();
}
}
</script>
</head>
<body onload="init();">
<canvas id="canvas" width="900"
height="500"></canvas><br>
</body>
</html>
|