Wednesday, September 12, 2012


Heart HTML 5 Homework 


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

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

 //Quadratic Curve 
 context.beginPath();
        context.moveTo(200, 200);
        context.quadraticCurveTo(300, 0, 400, 150);
        context.quadraticCurveTo(500, 0, 600, 200);
        context.quadraticCurveTo(500, 300, 400, 400);
        context.quadraticCurveTo(300, 300, 200, 200); 
        context.lineJoin = 'round'
        context.lineCap = 'round'
        context.lineWidth = 10;
        // line color
        context.strokeStyle = "rgb(255,51,153)";
        context.stroke();
   
        





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

};

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

No comments:

Post a Comment