...
var image = new Image();
image.onload = function() {
context.clearRect ( 0, 0, width, height );
context.drawImage(image, 0, 0, width, height);
var out = canvas.toDataURL("image/png");
send_data(out);
}
image.src = imgsrc;
$.fn.wheel=function(data, fn) {
return arguments.length ? this.on('wheel', null, data, fn) : this.trigger('wheel');
}