HTML画布的最大大小是多少?(What is the maximum size for an HTML canvas?)

编程入门 行业动态 更新时间:2024-10-06 15:20:10
HTML画布的最大大小是多少?(What is the maximum size for an HTML canvas?)

在HTML中创建大型可视化。

在Chrome(第18版)中,最大画布尺寸为32,768像素高。 有没有办法展示更大的画布?

这个限制来自哪里?

Creating a large visualization in HTML.

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

Where is this limit coming from?

最满意答案

32,768 = 2 152 15 - 1 = 32,767是short int可以容纳的最大数字。

因此,Google Chrome可能会使用数据类型short int来存储<canvas>元素的大小。

如果要显示较大的<canvas>元素,可以尝试使用多个元素。 如果你真的需要~33k像素,你还应该考虑另一种实现技术!

32,768 = 215 and 215 - 1 = 32,767 is the biggest number a short int can hold.

So Google Chrome probably uses the datatype short int for storing the sizes of a <canvas> element.

If you want to display larger <canvas> elements, you could try to use multiple ones. You should also consider another implementation technique if you really need ~33k pixels!

更多推荐

本文发布于:2023-08-07 16:57:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465255.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:画布   大小   HTML   canvas   size

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!