examples/script/context2d/scripts/quad.js
changeset 0 1918ee327afb
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 var canvas = document.getElementById('tutorial');
       
     2 
       
     3   // Make sure we don't execute when canvas isn't supported
       
     4   if (canvas.getContext){
       
     5 
       
     6     // use getContext to use the canvas for drawing
       
     7     var ctx = canvas.getContext('2d');
       
     8 
       
     9     // Draw shapes
       
    10 
       
    11     ctx.beginPath();
       
    12     ctx.moveTo(75,25);
       
    13     ctx.quadraticCurveTo(25,25,25,62.5);
       
    14     ctx.quadraticCurveTo(25,100,50,100);
       
    15     ctx.quadraticCurveTo(50,120,30,125);
       
    16     ctx.quadraticCurveTo(60,120,65,100);
       
    17     ctx.quadraticCurveTo(125,100,125,62.5);
       
    18     ctx.quadraticCurveTo(125,25,75,25);
       
    19     ctx.stroke();
       
    20 
       
    21   }