Tuesday, September 11, 2012
Code for heart
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
////////////////////////////////////// start below this line ˇˇˇˇˇˇˇˇˇˇ
context.beginPath();
context.moveTo(200, 200);
context.lineTo(400,500);
context.lineTo(600,200);
context.quadraticCurveTo(500, 10, 400, 200);
context.quadraticCurveTo(300, 10, 200, 200);
context.lineWidth = 10;
context.fillStyle = 'pink';
context.fill();
context.stroke();
////////////////////////////////////// end above this line ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ
};
</script>
</head>
<body>
<canvas id="myCanvas" width="800" height="600"></canvas>
</body>
</html>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment