Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
145
rated 0 times [  152] [ 7]  / answers: 1 / hits: 117289  / 13 Years ago, sat, may 21, 2011, 12:00:00

I'm working with a canvas element with a height of 600 to 1000 pixels and a width of several tens or hundreds of thousands of pixels. However, after a certain number of pixels (obviously unknown), the canvas no longer display shapes I draw with JS.



Does anyone know if there's a limit?



Tested both in Chrome 12 and Firefox 4.


More From » html

 Answers
14

Updated 10/13/2014



All tested browsers have limits to the height/width of canvas elements, but many browsers also limit the total area of the canvas element. The limits are as follows for the browsers I'm able to test:



Chrome:



Maximum height/width: 32,767 pixels

Maximum area: 268,435,456 pixels (e.g., 16,384 x 16,384)



Firefox:



Maximum height/width: 32,767 pixels

Maximum area: 472,907,776 pixels (e.g., 22,528 x 20,992)



IE:



Maximum height/width: 8,192 pixels

Maximum area: N/A



IE Mobile:



Maximum height/width: 4,096 pixels

Maximum area: N/A



Other:



I'm not able to test other browsers at this time. Refer to the other answers on this page for additional limits.






Exceeding the maximum length/width/area on most browsers renders the canvas unusable. (It will ignore any draw commands, even in the usable area.) IE and IE Mobile will honor all draw commands within the usable space.


[#92130] Thursday, May 19, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nathalieg

Total Points: 462
Total Questions: 106
Total Answers: 93

Location: Turks and Caicos Islands
Member since Tue, Mar 30, 2021
3 Years ago
;