AS3:How to change a colored Bitmap's BitmapData to black and white?

前端 未结 7 939
一整个雨季
一整个雨季 2020-12-14 13:35

How can I change the bitmapdata of a coloured Bitmap to Black and White in AS3 ? I\'m developing a simple image editor tool for a CMS in f

7条回答
  •  眼角桃花
    2020-12-14 14:07

    I use this snipper:

    //Tweens to black and white
    TweenLite.to(DisplayObjectYouWantToTween ,1,{colorMatrixFilter:{matrix:[0.3,0.59,0.11,0, 0,0.3,0.59,0.11,0,0,0.3,0.59,0.11,0,0,0,0,0,1,0]}});
    
    //Tween from black and white to Color
    TweenLite.to(DisplayObjectYouWantToTween,1,{colorMatrixFilter:{matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]}});
    

提交回复
热议问题