What is the maximum size for an HTML canvas?

Create great visualization in HTML.

In Chrome (v. 18), the maximum canvas size is 32,768 pixels. Is there a way to display a larger canvas?

Where does this limit come from?

+3
source share
1 answer

32,768 = 2 15 and 2 15 - 1 = 32,767 - this is the largest number a short int.

Therefore, Google Chrome probably uses a data type short intto store element sizes <canvas>.

If you want to display larger elements <canvas>, you can try using a few. You should also consider a different implementation technique if you really need ~ 33k pixels!

+4

All Articles