I have a code like this:
var bitmapData:BitmapData = new BitmapData(width, height);
bitmapData.draw(this);
var ba:ByteArray = (new PNGEncoder()).encodeByteArray(bitmapData.getPixels(clipRect),width,height,true);
I want to make the white color in the generated PNG transparent. What is the best way to do so?