Q:

Draggables and resizables elements in inside HTML5 canvas

Is it possible to make elements inside a HTML5 Canvas element draggable and resizable. Is there any way to make the dynamic image in the following code to be movable:
var ctx, imgArray;

function initAll() {
    ctx = document.getElementById("canvas").getContext("2d");
    imgArray = ["http://i46.tinypic.com/nqe1dt.jpg", 
                    "http://i50.tinypic.com/i21phi.jpg", 
                    "http://i49.tinypic.com/1zmfcrq.jpg", 
                    "http://i50.tinypic.com/v8g6mo.jpg", 
                    "http://i49.tinypic.com/21kh7ah.jpg"];
    drawCanvas();
    document.getElementById("checkgroup").onchange = drawCanvas;
}

function drawCanvas() {
   ctx.clearRect(0, 0, 600, 400);
   for(var i=0; i < imgArray.length; ++i) {
      var img = new Image();
      img.posX = (i < 3) ? i*200 : (i-2.5)*200;
      img.posY = (i < 3) ? 0 : 200;
      img.src = imgArray[i];
      img.onload = function() {
        ctx.drawImage(this, this.posX, this.posY, 150, 150);
      } 
   }
}
window.onload = initAll;

The project is found at JSBin: http://jsbin.com/welcome/7209/edit

A:

Use KineticJS which provides shape object support for canvas.
KineticJS will provide mouse events for its shapes and thus you can implement drag-like functionality more easily:
http://www.html5canvastutorials.com/kineticjs/html5-canvas-drag-and-drop-tutorial/

