读取Image显示

package {
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.Loader;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.net.URLRequest;

        public class picBig extends Sprite
        {
                private var _bitmap:Bitmap;
                private var _bitmap2:Bitmap;
                
                public function picBig()
                {
                        startLoading();
                }
                
                private function startLoading():void
                {
                        var loader:Loader = new Loader();
                        var request:URLRequest = new URLRequest( "PV3DFileLoad.jpg" );
                        loader.contentLoaderInfo.addEventListener( Event.COMPLETE, loaded );
                        loader.load( request );
                }
                
                private function loaded( event:Event ):void
                {
                        _bitmap = event.target.content as Bitmap;
                        var dataA:BitmapData = new BitmapData( _bitmap.width, _bitmap.height, true, 0xffffffff );
                        _bitmap2 = new Bitmap( dataA );
                        addChild( _bitmap2 );
                        for(var i:int = 0; i<_bitmap.width; i++){
                                for(var j:int = 0; j<_bitmap.height; j++){
                                        dataA.setPixel( i, j, _bitmap.bitmapData.getPixel( i, j ) );
                                }
                        }
                }
        }

你可能感兴趣的:(.net,Flash,J#)