I am trying to export transparent PNG files using this class: com.adobe.images.PNGEncoder;
var pngSource:BitmapData = new BitmapData (stage.stageWidth, stage.stageHeight); pngSource.draw(stage); var ba:ByteArray = PNGEncoder.encode(pngSource); var file:File = File.desktopDirectory.resolvePath("test.png"); var fileStream:FileStream = new FileStream(); fileStream.open(file, FileMode.WRITE); fileStream.writeBytes(ba); fileStream.close();
Everything works fine - except for the transparent issue ...
If I could get the color of the Flash scene, then it will work - but, unfortunately, there is no such option.
Are there any options that I am missing?
source share