开发者

How do I replace colours in a movieclip?

I am trying to take a movieclip of a character and change the colour of their clothes. The character is comprised of vectors.

So far I have semi-sucessfully used this method:

  1. stop the movieclip
  2. take the bitmap data from the current frame
  3. use threshold to replace th开发者_JS百科e colour
  4. store the resulting bitmap data in an array
  5. add an onenterframe function - clear the current frame and add the bitmap data from the processed data in the array

So - this works pretty well. Each frame is only processed once at the beginning and then the write to the movieclip is very quick.

However! As the replacement is being performed on a bitmap there is an amount of aliasing that takes place to remove jaggies/pixelation. This produces colours that are not matched using threshold. So the main colour is replaced correctly but it is surrounded by a halo of mixed colours :(

I am sure there should be a better way to do this. Any ideas or answers would be greatly apreciated - Thanks.


Would playing with Grant Skinner's easier to use ColorMatrix class ) get the job done ?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜