title: How to use the method setPixels(rectangle, byteArray) of bitmapData in Adobe Flex
body: <pre><code>Error #2030: End of file was encountered.
  </code></pre>
  
  <p>This method is not working </p>
  
  <p>I am using it like this</p>
  
  <pre><code>var ba:ByteArray = new ByteArray();
  ba = bmd.getPixels(bmd.rect);
  
  bmd.setPixels(srcRect, ba);
  bm.bitmapData = bmd;
  
  img.source = bm;
  </code></pre>