long setCanvasSize(int width, int height)

This method changes the size of the view's canvas to width by height, without changing the size of its window. By default, the canvas is the same size as the client area of the view's window. If the canvas is made larger than the window, more of the map is rendered than is visible on the screen.  If the canvas is made smaller than the window, redraws will not cover the entire window.  The canvas can not be made larger than the display device.

Note that it is the canvas that determines what is printed or output as imagery.

The method returns zero upon success, and returns an error code if the arguments are invalid.