用Texture2D.initWithData()显示图像,基本的调用方法就是 texture2D.initWithData(data, format, nImageWidth, nImageHeight); 其中data是Uint8Array,长度=nImageWidth * nImageHeight,值是0或255, format=Texture2D.PixelFormat.I8。
结果是有的图像能显示,有的不能显示。不能显示的时候错误是“WebGL: INVALID_OPERATION: texImage2D: ArrayBufferView not big enough for request”。
各图像都是调用同一个函数,主要的差别好像只有图像尺寸不同。比如 14402048 和 20481650 可以正常显示。但 13502048,14652048 就会报错。已确认数据长度,参考日志如下:
请教各位是什么地方的问题?
@panda
@huanxinyin
谢谢!


<img