The way to do this, is by handling the click event of the canvas, and then figure out yourself what part of the canvas is clicked:
canvas.addEventListener("mouseup", doMouseClick, false);
var doMouseClick = function(event)
{
//Some magic to have the exact coordinates in the canvas:
var clickPos = {
x : event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft - Math.floor($(canvas).offset().left);,
y : event.clientY + document.body.scrollTop + document.documentElement.scrollTop - Math.floor($(canvas).offset().top) + 1
}
//check the image
if (clickPos.x > 128 && clickPos.y < 128 + imageObj.width
&& clickPos.y > 128 && clickPos.y < 128 + imageObj.height){
console.log("Oh boy! Someone clicked the image!");
}
}
The reason why we have to do it this way, is because the you don't "add" your image as a child to the canvas, you "draw" it on the canvas. The canvas just shows pixels and has no idea what is actually drawn.