BitmapData to ByteArray

/ Published in: ActionScript 3
Save to your folder(s)

Copy this code and paste it in your HTML
  1. import;
  2. import flash.utils.ByteArray;
  3. var encoder:JPEGEncoder = new JPEGEncoder(90);
  4. var byteArray:ByteArray = encoder.encode(bitmapData));
  5. // result: byteArray


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.