Created
          April 26, 2010 23:37 
        
      - 
      
 - 
        
Save seanmcgary/380094 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <title>Canvas Tutorial</title> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| function draw(){ | |
| //get a reference to the canvas | |
| var canvas = $('#canvas')[0].getContext("2d"); | |
| //draw a circle | |
| canvas.beginPath(); | |
| // x coord, y coord, radius, start angle, end angle, anticlockwise | |
| canvas.arc(200, 100, 20, 0, Math.PI*2, true); | |
| canvas.closePath(); | |
| canvas.fill(); | |
| } | |
| </script> | |
| </head> | |
| <body onload="draw()"> | |
| <canvas id="canvas" width="500" height="500"></canvas> | |
| </body> | |
| </html> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment