There are many ways to call drawImage
One of them:
ctx.drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh)
Where dx, dy, dw, dh is the destination x, y, width and height.
If you make dw and dh always 800x600, the drawn image will always automatically scale to 800x600.
Here is a tiny example that will always draw any image up to 800x600 in size http://jsfiddle.net/jAT8Y/
source share