Bitmap too big as3

2019-03-04 16:44发布

In AS3, I am loading a png from a zip file (nochump's zip library through ByteArray to Loader). The png can be up to 45k pixels wide but only 120 tall. This creates a problem in flash, as images can only be ~8000 pixels wide. A possible solution would be to split the images into 6 columns somehow. This would probably need to be done in the ByteArray state, because the limitation is in Bitmap and Loader. Would this even be possible?

2条回答
男人必须洒脱
2楼-- · 2019-03-04 16:56

All things are possible since you have the bytes. However this would require you to write a complete png library in actionscript. PNG is a very complicated and sophisticated compressed image format, so you can't just shred the image into blocks by copying portions of the ByteArray.

So really, the answer is no, it is not possible. Sorry.

If it was an uncompressed BMP on the other hand you would be in with a chance. However I suspect that if you are able to change the format of the file, it would be easier to pre-split the image into columns.

查看更多
贼婆χ
3楼-- · 2019-03-04 17:03

I believe you should use Alchemy to decode such a large file and put it in a Byterray. It looks like it has been done for JPEG, PNG shouldn't be very different!

http://segfaultlabs.com/devlogs/alchemy-loading-large-jpeg-images

查看更多
登录 后发表回答