位图太大 as3
在AS3中,我从zip文件加载png(nochump的zip库通过ByteArray到Loader)。 png 的宽度最大可达 45k 像素,但高度仅为 120 像素。这在 Flash 中产生了一个问题,因为图像的宽度只能约为 8000 像素。一个可能的解决方案是以某种方式将图像分成 6 列。这可能需要在 ByteArray 状态下完成,因为限制在于 Bitmap 和 Loader。这可能吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信你应该使用 Alchemy 来解码这么大的文件并将其放入
Byterray
中。看起来是针对JPEG做的,PNG应该差别不大!http://segfaultlabs.com/devlogs/alchemy-loading-large-jpeg-images
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
因为你有字节,所以一切皆有可能。然而,这需要您在 actionscript 中编写一个完整的 png 库。 PNG 是一种非常复杂且复杂的压缩图像格式,因此您不能通过复制 ByteArray 的部分来将图像分解为块。
所以实际上,答案是不,不可能。对不起。
另一方面,如果它是未压缩的 BMP,那么您就有机会。但是我怀疑,如果您能够更改文件的格式,那么将图像预先分割成列会更容易。
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.