Maximum size of a element

后端 未结 14 1735
粉色の甜心
粉色の甜心 2020-11-22 07:34

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, aft

相关标签:
14条回答
  • 2020-11-22 08:26

    The limitations for Safari (all platforms) are much lower.

    Known iOS/Safari Limitations

    For example, I had a 6400x6400px canvas buffer with data drawn onto it. By tracing/ exporting the content and by testing on other browsers, I was able to see that everything was fine. But on Safari, it would skip the drawing of this specific buffer onto my main context.

    0 讨论(0)
  • 2020-11-22 08:27

    On PC-
    I don't think there is a restriction but yes you can get out of memory exception.

    On Mobile devices-
    Here is the restrictions for the canvas for mobile devices:-

    The maximum size for a canvas element is 3 megapixels for devices with less than 256 MB RAM and 5 megapixels for devices with greater or equal than 256 MB RAM.

    So for example - if you want to support Apple’s older hardware, the size of your canvas cannot exceed 2048×1464.

    Hope these resources will help you to pull you out.

    0 讨论(0)
提交回复
热议问题