1 Reply Latest reply: Aug 20, 2012 5:33 PM by jsmith RSS

    Drawing large canvas

      Dear all,

      I'm doing some exercises with the canvas and drawing on it. Is there an elegant way to paint large canvas, e.g. for a map of a tile based board game? I'm trying to create a 4000/4000 pixel canvas but get always an out of memory or null pointer exception. Additionally the performance when scrolling in a scrollpane of the canvas is pretty bad.

      Regards Bo.
        • 1. Re: Drawing large canvas
          I think you might want create to a tile of canvases, e.g. instead of one 4000/4000 canvas, create 64 500/500 canvases and see how that goes . . .

          Internally, for a hardware pipeline, I think a canvas eventually ends up mapping to a texture on a videocard.
          Video cards place size (x,y as well as total mem) limits on what the textures can be.

          Also ensure that you have enough memory allocated to the jvm.

          Stack traces and sample code might get you more assistance.