Any ideas? How to flip a bitmap and preserve alpha?

Elia

----- Original Message ----- From: "Elia Morling" <[EMAIL PROTECTED]>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Tuesday, October 14, 2008 12:08 PM
Subject: [Flashcoders] Flip BitmapData with Alpha


How do I preserve alpha when flipping a bitmapdata? This is what I use now.

public static function flipHorizontal(source:BitmapData):BitmapData{
 var m:Matrix = new Matrix();
 m.a=-1;
 m.tx=source.width;
var bmd:BitmapData = new BitmapData(source.width, source.height, source.transparent);
 bmd.draw(source, m);
 return bmd;
}

Thanks
Elia _______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to