本文介绍了如何在Flash中加载和分割大量图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何加载一张超过 注意:这是。

解决方案

它必须是原始格式zlib)。当你加载它(通过urlloader或套接字)你分裂块结果bytearray,你可以填充一些预生成的bitmapdatas与他们。例如:你加载一个5120x5120原始24位img。你通过urlloader加载它并得到它的bytearray。然后,创建n个位图数据块(10x10 512px边)和n个字节数组(512x512 * 4)。然后循环整个步幅,并将读取的数据放入与适当的图块关联的字节数组中。最后你循环所有的瓷砖,并调用setPixels为他们每个人传递相关的缓冲区作为一个理由


How do you load an image that exceeds 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

这篇关于如何在Flash中加载和分割大量图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 14:33