title: Make image drawn on canvas draggable with JavaScript
body: <p>I was able to successfully draw an image on an HTML canvas. But I need to be able to drag the image about on the canvas.</p>
  
  <p>I know this function can be implemented easily by some JavaScript libraries like KinectJS. But I want to just do it with simple JavaScript.</p>
  
  <pre class="lang-js prettyprint-override"><code>window.onload = function(){
  var canvas = document.getElementById("myCanvas");
  var context = canvas.getContext("2d");
  var destX = 0;
  var destY = 0;
  var imageObj = new Image();
  
  imageObj.onload = function(){
    context.drawImage(imageObj, destX, destY);
  };
  imageObj.src = "westeros.png";
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;canvas id="myCanvas" height=1024 width=360&gt;&lt;/canvas&gt;
  </code></pre>