setSize

setSize() can be used to resize the canvas. In this example, a timer changes the size of the canvas.