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"));
}
As of now, I am creating JPEG image from bitmapdata as above.
I can use PNGEncoder for creating png images as well.
How do I create .bmp or .gif files?