views:

738

answers:

1

I need to copy multiple images with transparency to the same BitmapData without the overlapping images' transparencies overwriting the existing pixels.

By default when you use the copyPixels method on a BitmapData with transparency to a BitmapData without transparency, the images layer like I want. The issue is I need to render to a BitmapData layer with transparency to another BitmapData with transparency. I want to maintain the transparency of the bitmapdata but still get the overlapping effect.

Can anyone think of a inexpensive way to achieve this?

+1  A: 

Tenatively, I believe this solution works:

bitmapData.copyPixels( source, rectangle, point, null, null, true );

The last property "mergeAlpha" when set to true appears to fix this.

grey