Error #2030: End of file was encountered.
This method is not working
I am using it like this
var ba:ByteArray = new ByteArray();
ba = bmd.getPixels(bmd.rect);
bmd.setPixels(srcRect, ba);
bm.bitmapData = bmd;
img.source = bm;
You need to reset the possition of your Byte Array (ba.position = 0) before re-using it
var ba:ByteArray = new ByteArray();
ba = bmd.getPixels(bmd.rect);
ba.position = 0;
bmd.setPixels(srcRect, ba);
bm.bitmapData = bmd;
img.source = bm;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With