Tuesday, September 11, 2012

Heart

Code:


<!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.rect(0, 0, 800, 600);
context.stroke();

context.fillStyle = 'rgb(255, 100, 100)';
context.fill();

context.beginPath();
context.moveTo(400, 200);
context.bezierCurveTo(550, 50, 550, 300, 400, 450);
context.lineWidth = 10;
context.strokeStyle = "black";
context.stroke();

context.beginPath();
context.moveTo(406, 200);
context.bezierCurveTo(250, 50, 250, 300, 406, 450);
context.lineWidth = 10;
context.strokeStyle = "black";
context.stroke();


////////////////////////////////////// end above this line ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ

};

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

No comments:

Post a Comment