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

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