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

前端 未结 7 871
一整个雨季
一整个雨季 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:14

    actually, you can use back2dos 's solution in a much easier way:

    const rc:Number = 1/3, gc:Number = 1/3, bc:Number = 1/3;
    mc.filters = [ new ColorMatrixFilter([rc, gc, bc, 0, 0,rc, gc, bc, 0, 0, rc, gc, bc, 0, 0, 0, 0, 0, 1, 0]) ];
    

    where mc is the MovieClip or Sprite container where the bitmapdata exists as a visual element. thanks back2dos :)

    0 讨论(0)
提交回复
热议问题