小程序画布高度超过1365px无法画图?
发布于 3 年前 作者 yongfan 4690 次浏览 来自 官方Issues
当用小程序的canvas画图时,画布高度过长时,无法画图(目前测试临界点为1365px)。
canvas.width = Width * this.dpi;
canvas.height = h * this.dpi;
const ctx = canvas.getContext("2d");
ctx.scale(this.dpi, this.dpi);
this.width = width;
this.height = h;
// 上述代码在h超过1365时无法生效。
3 回复

用过 wxa-plugin-canvas 海报组件,生成的演员模卡挺正常的,没有遇到高度限制问题,是个开源组件,可以参考下

width: 4800, //rpx
height: 3600, //rpx

 canvas很占用资源,所以高度不可能无限大,那样可能会崩溃,所以微信应该是做了限制。

不用2d 可以画超出1365的么

回到顶部