Maximum size of a element

后端 未结 14 1732
粉色の甜心
粉色の甜心 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: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.

提交回复
热议问题