WEB开发网      濠靛倻鏅悵顖涚附閽樺鐎诲ù婊庡亾缁辨帗鎷呴悩鍨暠濞戞挴鍋撳ù鐘烘閸ㄥ孩绂嶉锝喰﹂柟瀛樺灣濠婃垿鎯冮崟顏嗩伇濞寸姾妫勬慨鈺呭礉濞戝磭骞㈤悹鍥у槻閸ㄥ孩绂嶉敓锟� ---闁挎洩鎷�
开发学院图形图像Flash Understanding AS3 ColorMatrixFilter class 阅读

Understanding AS3 ColorMatrixFilter class

 2009-10-27 00:00:00 来源:WEB开发网 闁靛棴鎷�闁告垵绻愰惃顒傗偓娑欍仦缂嶏拷濠⒀呭仜閵囧洨鈧稒銇炵紞锟�闁靛棴鎷�  闁稿繗娅曢弫鐐哄级閵婏缚鑸瀣仧濞堟垵顕ラ鐓庤Е
核心提示:Do you want to apply color correction to images into your Flash movies on the fly?Then ColorMatrixFilter is the class you need.The ColorMatrixFilter class lets

Do you want to apply color correction to images into your Flash movies on the fly?

Then ColorMatrixFilter is the class you need.

The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha values of every pixel in the input image to produce a result with a new set of RGBA color and alpha values.

The color matrix filter separates each source pixel into its red, green, blue, and alpha components as srcR, srcG, srcB, srcA.

To calculate the result of each of the four channels, the value of each pixel in the image is multiplied by the values in the transformation matrix.

It allows saturation changes, hue rotation, luminance to alpha, and various other effects.

For more information visit the official Adobe docs page.

Around the web you can find a lot of examples of photos loaded with Flash and sliders to change colors, but I want to explore this feature from a coding point of view.

I will make some experiment on this photo I found on Flickr

Understanding AS3 ColorMatrixFilter class

The first thing is creating a MovieClip with the image inside. I called it cats, so with this simple code I display the cats on the stage:

1 2 3 4  下一页

Tags:Understanding AS ColorMatrixFilter

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接