0

I saw on the Internet the different max size and area of a canvas. I would like to change them for my project because i create canvas of 5000px / 2600px. I test to put a smaller canvas (300px / 300px) and it works i've no error (NS_ERROR_FAILURE)

Thank's all

wyllisMonteiro
  • 61
  • 3
  • 11

3 Answers3

0

You may use CSS for that, in your webpage.

<head>
<style>
canvas{
       width: 300px;
       height: 300px;
}
</style>
</head>
  • Thank you for helping but i already tried it, I saw on the internet that maybe it was because a canvas should not exceed 4096/4096. There is no solution i think – wyllisMonteiro Aug 06 '18 at 07:59
0

Canvas size is device dependent. Have a look at Maximum size of a <canvas> element, this may help you to resolve the issue.

PM12
  • 434
  • 1
  • 3
  • 6
0

You can't change the maximum canvas size supported by a browser, but you can detect it and avoid creating canvas elements that exceed the browser's size limitations.

See my answer in the Maximum size of a <canvas> element thread for details.

John Hildenbiddle
  • 3,115
  • 2
  • 19
  • 14