1
public function bmdToStr(bmd:BitmapData,width:int,height:int):String {
var encoder:JPEGEncoder = new JPEGEncoder();
var encBytes:ByteArray = encoder.encode(bmd);
return ImageSnapshot.encodeImageAsBase64(new ImageSnapshot(width,height,encBytes,"image/jpeg"));
}
截至目前,我正在如上所述從bitmapdata創建JPEG圖像。
我也可以使用PNGEncoder來創建png圖像。
如何創建.bmp或.gif文件?用flex創建gif/bmp文件