Asynchronous Bitmap Decoding

Must Read

Just post!

An improvement to AIR 2.6 allows the decoding of bitmaps on a separate thread. To take advantage of this, use the LoaderContext class as follows:


import flash.system.LoaderContext;
import flash.display.Loader;
var lc:LoaderContext = new LoaderContext();
lc.imageDecodingPolicy = ImageDecodingPolicy.ON_LOAD;
var loader:Loader = new Loader();
loader.load(new URLRequest(“image.jpg”, lc);


This improvement also works with Loader.loadBytes().

The asynchronous decoding allows animations to play smoother. For instance, while you have an animation running, you can now load another graphic in the background without concern that the process will temporary interrupt the animation.

Previous articleCustom Cursor
Next articleCaching Assets
- Advertisement -

Latest News

Ideanomics’ subsidiary Energica to provide electric motorcycles for the upcoming G20 Bali summit

Ideanomics (Nasdaq: IDEX), a global company focused on accelerating the commercial adoption of electric vehicles (EV), today announced that its...
- Advertisement -

More Articles Like This

- Advertisement -