开发者

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 wi开发者_高级运维th 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜