Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
    <style>
        canvas {
            border:1px solid #444;
        }
    </style>
  <!--[if IE]><script type="text/javascript" src="http://jimmyinteractive.com/games/Lib/excanvas.js"></script><![endif]-->
  
</head>
<body onload="load();">
  <h1>Draw an image</h1>
  <p>drawImage(img,x,y) will draw an image.  You need to replace the "x" and "y" with the position you want to draw the image. The first parameter   is the image that it will draw. For no dont worry about it.</p>
  <p>Follow the steps below</p>
  <ol>
    <li>Draw image to canvas right after //todo: draw image.  
      <pre>
        ctx.drawImage(img,50,50);
        
      </pre>
    </li>
    
     <li>Draw another image at position 150,200 right after the first image.  
      <pre>
        ctx.drawImage(img,150,50);
        
      </pre>
    </li>
     <li>Draw 3 more images.  You chose there they should go.  
      <pre>
        ctx.drawImage(img,150,50);
        
      </pre>
    </li>
       <li>Change the image source by updating the src value
      <pre>
       img.src = 'http://goo.gl/KXVpTD';
      </pre>
    </li>
     
 
    
  </ol>
  <canvas id="cv" width="400" height="600"></canvas>
 
 
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
jamesfdickinsonpro
0viewers