I am reading in an image through FileReader() and creating a new image object to put into a canvas. I successfully get the image into my canvas but I can not set the attributes of width and height to fit into my 600x800 canvas. The image retains its original size. How can I change the dimensions of the new Image object?
reader.onload = function(e) {
var imgObj = new Image();
imgObj.src = e.target.result; //Successfully sets src
imgObj.setAttribute("height", 200);
imgObj.setAttribute("width", 400);
ctx.drawImage(imgObj,0,0);
}