Skip to content Skip to sidebar Skip to footer

What Is The Maximum Size For An Html Canvas?

Creating a large visualization in HTML. In Chrome (v. 18), the maximum canvas size is 32,768 pixels high. Is there a way to display a larger canvas? Where is this limit coming from

Solution 1:

32,768 = 2 and 2 - 1 = 32,767 is the biggest number a short int can hold.

So Google Chrome probably uses the datatype short int for storing the sizes of a <canvas> element.

If you want to display larger <canvas> elements, you could try to use multiple ones. You should also consider another implementation technique if you really need ~33k pixels!

Post a Comment for "What Is The Maximum Size For An Html Canvas?"