开发者

How does one load and split a massive image in flash?

How do you load an image that exc开发者_运维技巧eeds the 4096×4096 limitations of flash while splitting it?

Note: This is a direct extension of another question.


it must be in a raw format (or compressed with zlib).As you load it (via urlloader or socket) you split the resulting bytearray in chunks and you can populate some pregenerated bitmapdatas with them.Example:you're loading a 5120x5120 raw 24bits img. you load it via urlloader and get its bytearray. then, you create n bitmapdata tiles (10x10 512px side) and n bytearrays(512x512*4).then you cycle the whole stride and put the read data in the bytearray associated to the proper tile. lastly you cycle all tiles and call setPixels for each of them passing the associated buffer as an argumen


I've given an answer to such a question here. When loaded to a ByteArray as a bitmap you can split it as you want... Or you can even find/write a C program which does it for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜