Tuesday, September 11, 2012


<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("mycanvas");
var context = canvas.getContext("2d");

///////////////////////// start below this line

//Heart
context.beginPath();
context.moveTo(400,200);
context.quadraticCurveTo(600,50,400,500);
context.lineWidth = 10;
context.lineCap = 'round';

// line color
context.strokeStyle = 'rgb(330,0,300)';
context.fillStlye = 'rgb(330,0,300)';
context.fill();
context.stroke();


context.beginPath();
context.moveTo(400,200);
context.quadraticCurveTo(200,50,400,500);
cpntext.lineWidth = 10;
context.fillStyle = 'rgb(330,0,300);
context.fill();
context.stroke();


/////////////////////////////// end below this line

};

</script>
</head>
<body>
<canvas id="myCanvas" width="800" height="600"></canvas>
</body>
</html>


No comments:

Post a Comment