/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import flash.display.Loader; import flash.display.LoaderInfo; import flash.events.Event; import flash.display.BitmapData; Â var loader:Loader = new Loader(); loader.loadBytes(byteArray); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete); Â private function loaderComplete(event:Event):void { Â Â Â Â var loaderInfo:LoaderInfo = LoaderInfo(event.target); Â Â Â Â var bitmapData:BitmapData = new BitmapData(loaderInfo.width, loaderInfo.height, false, 0xFFFFFF); Â Â Â Â bitmapData.draw(loaderInfo.loader); Â Â Â Â // result: bitmapData }
URL: http://blog.yoz.sk/2009/10/bitmap-bitmapdata-bytearray/