Flash AS3 截图后生成图片到本地 (附带flex版)

2019-04-15 16:49发布

import mx.graphics.codec.JPEGEncoder; private var file:FileReference = new FileReference(); var bitmapData:BitmapData = new BitmapData(pic.width, pic.height); bitmapData.draw(pic,new Matrix()); var bitmap : Bitmap = new Bitmap(bitmapData); var jpg:JPEGEncoder = new JPEGEncoder(); var ba:ByteArray = jpg.encode(bitmapData); file.save(ba,"name.jpg");