I have a canvas object that I want to put an image in for a web application. I can get the image loaded, but I\'ve run into 2 problems: The image won\'t stretch to the canva
width
and height
of image are read-only so that won't work.
Try instead:
context.drawImage(image, 0, 0, canvas.width, canvas.height);
This will draw the image the same dimension as the canvas is (you don't need to reload the image every time btw. - just load it once globally and reuse the image
variable.)