加载位图,获得bitmapData

var loader:Loader=new Loader();
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
            try {
                loader.load(new URLRequest("assets/兔年.jpg"));
            }catch(e:Error) {
                Alert.show(e.toString());
            }
 
private function onComplete(event:Event):void {
            var urlLoader:LoaderInfo=event.target as LoaderInfo;
            var bitmap:Bitmap=urlLoader.content as Bitmap;
         
        }

你可能感兴趣的:(加载位图,获得bitmapData)