title: copy canvas to another canvas
body: <p>i use this function for copy old canvas to new canvas </p>
  
  <pre><code>function cloneCanvas(oldCanvas) {
  
          //create a new canvas
          var newCanvas = document.createElement('canvas');
          var context = newCanvas.getContext('2d');
  
          //set dimensions
          newCanvas.width = oldCanvas.width;
          newCanvas.height = oldCanvas.height;
  
          //apply the old canvas to the new one
          context.drawImage(oldCanvas, 0, 0);
  
          //return the new canvas
          return newCanvas;
      }
  </code></pre>
  
  <p>and i use this function like this</p>
  
  <pre><code>            var oldCanvas = $(this).parent().parent().find('td:first-child canvas')
  
              $("div.previewImg").append(cloneCanvas(oldCanvas))
  </code></pre>
  
  <p>but i get this error :(</p>
  
  <pre><code>Failed to execute 'drawImage' on 'CanvasRenderingContext2D': No function was found that matched the signature provided
  </code></pre>
  
  <p>please help me , how i can solve this error</p>
  
  <p>thank you</p>