drawing custom shape in canvas html5 with path and curve - Javascript Canvas

Javascript examples for Canvas:Path

Description

drawing custom shape in canvas html5 with path and curve

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=( function() {//from w ww  .j a v a  2 s.c o m
var canvas = document.getElementById('myCanvas');
var ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.moveTo(10,50);
ctx.quadraticCurveTo(50, 10, 100, 50);
ctx.moveTo(10,50);
ctx.quadraticCurveTo(50, 90, 100, 50);
ctx.stroke();
    });

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

Related Tutorials