Revision: 48078
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at June 23, 2011 07:22 by Heol
Initial Code
import flash.display.Loader; import flash.display.LoaderInfo; import flash.events.Event; import flash.net.URLRequest; import flash.display.BitmapData; Â var loader:Loader = new Loader(); loader.load(new URLRequest("banner1.jpg")); 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 }
Initial URL
http://blog.yoz.sk/2009/10/bitmap-bitmapdata-bytearray/
Initial Description
Initial Title
Image (Loader) to BitmapData
Initial Tags
Initial Language
ActionScript 3