How can I resize an image within a canvas using JQuery in a way that only the image is resized, not the entire canvas?
function resizeImage(width, height){
var image = document.getElementById('resizeImage'),
canvas = document.createElement('canvas'),
ctx = canvas.getContext('2d');
ctx.drawImage(image,cropLeft, cropTop, cropWidth, cropHeight,10,10,width,height);
return canvas;
};
The above function resizes the image but includes extra canvas in the result;
Is there a simple JQuery or HTML solution to resize the image with fixed height and width without affecting the canvas?