<html>
<head>
<script type="application/javascript">
function init() {
var canvas = document.getElementById("canvas");
if (canvas.getContext)
{
var ctx = canvas.getContext("2d");
ctx.textBaseline = "top";
// Draw a rectangle and text with lineWidth 1.0
ctx.lineWidth = 1.0;
ctx.strokeRect( 100,20,100,30)
ctx.font="40px verdana";
ctx.strokeText("Believe", 300,20);
// Now, increase the lineWidth and notice the difference in the lines
ctx.lineWidth=3.0;
ctx.strokeRect( 100,60,100,30);
ctx.strokeText("Believe", 300,60);
}
}
</script>
</head>
<body onload="init();">
<canvas id="canvas" width="900"
height="500"></canvas><br>
</body>
</html>
|