AS3 Flex masks with black background from png bitmap

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

If so, can I convert the bitmapData I'm loading to treat black as transparent?

early.

+2


a source to share


1 answer


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

Set the source to an alpha bitmap and the source channel to R, G or B and the target channel to Alpha



an example of use is in the link

+2


a source







All Articles