Is there a max size for images being loaded onto canvas on iPhone?

时间秒杀一切 提交于 2019-12-24 07:40:35

问题


I am building a webapp game that has a scrolling background. The background is just a really tall image that is copied to the smaller canvas in slices to give the sensation of movement. The image file I started with was 6000px tall (my canvas is 640px tall). All desktop browsers and iPad2 (iOS 6) loaded the image file fine and the animation looks great.

However, on iPhone 4S (iOS 5) - the background never loads at all! I solved the problem by just cutting the big background image down until it was under 2000px tall, and there the iPhone finally loaded the graphics onto the canvas and everything works great from there.

So my question is - is there a maximum file size that the javascript canvas.context can handle? Maybe just on certain devices?

I tried all kinds of other work arounds to ensure the file was completely loaded before the JS code ran on the canvas, to no avail.

来源:https://stackoverflow.com/questions/13365870/is-there-a-max-size-for-images-being-loaded-onto-canvas-on-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!