title: How can you fill a shape created in javascript with an image?
body: <p>How can you fill a shape created in javascript with an image?</p>
  
  <p>I am using a shape I created with javascript and am right now filling it with a color. How can I replace that and fill it with an image/gif of my choice? </p>
  
  <pre><code>function shape(x,y) {
  
          ctx.fillStyle = "#9dd4ff";
          ctx.beginPath();
          ctx.moveTo(232,213)
          ctx.lineTo(315,198);
          ctx.lineTo(x,y);
          ctx.closePath();
          ctx.fill();
  }
  </code></pre>