airlocker
airlocker

Reputation: 71

AS3 Flex masks with black background from png bitmap

What I am trying to achieve might be trivial, however I am loading a PNG mask which does not have a transparent background, but rather a black background, with the shape defined on top in white (the actual mask which needs to be applied). Apparently Flex expects me to provide a mask with a transparent background for it to work, or am I missing something?

If that's the case, could I transform the bitmapData which I am loading so that it treats black color as transparent?

thanks in advance.

Upvotes: 2

Views: 1600

Answers (1)

Daniel
Daniel

Reputation: 35734

One way is to BitmapData's CopyChannel This works best if you are trying to apply one bitmap as the alpha layer of another bitmap.

Set the source to your alpha bitmap and the source channel to R,G or B, and destination channel to Alpha

example of use is in the link

Upvotes: 2

Related Questions