title: AS3 bitmapData.Draw is very inefficient
body: <p>I am using ActionScript 3 in Flash CS6 with Adobe AIR 3.4</p>
  
  <p>I am trying to load an image from the file system into a Bitmap.</p>
  
  <p>My current code is:</p>
  
  <pre><code>var loader = new Loader();
  loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
  loader.load(new URLRequest("assets\\" + filename));
  
  private function loadComplete(e:Event):void
  {
      //add to bitmap
      bitmap = new Bitmap();
      bitmap.bitmapData = new BitmapData(loader.width, loader.height, true, 0x000000);
  
      bitmap.bitmapData.draw(loader);
  }
  </code></pre>
  
  <p>However there is very inefficient performance at bitmapData.draw (the image is 2048x1536).
  I have tried:</p>
  
  <pre><code>bitmap.bitmapData = e.target.content.bitmapData;
  </code></pre>
  
  <p>However it does not affect the performance. And is still very slow.</p>
  
  <p>How can I load the image in the loader into a Bitmap without having such slow performance.</p>