Monday, September 10, 2012

My Heart...

Here is my heart masterpiece!!! enjoy :)

The code to my 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.rect(0, 0, canvas.width, canvas.height);
context.fillStyle = 'rgb(100,50,100)'
context.fill();


context.beginPath();
context.moveTo(400,600);
context.quadraticCurveTo(650,500,700,300);
context.bezierCurveTo(700,150,550,50,400,200);
context.bezierCurveTo(300,50,100,150,100,300);
context.quadraticCurveTo(150,500,400,600);
context.fillStyle = 'rgb(255,50,50)'
context.fill();





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

};

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




No comments:

Post a Comment