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 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
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:
Tags:Understanding AS ColorMatrixFilter
编辑录入:爽爽 [复制链接] [打 印]- ››asp.net页面弄成伪静态页面
- ››Asp.net 中将汉字转换成拼音的方法
- ››ASP.NET及JS中的cookie基本用法
- ››ASP.NET获取MS SQL Server安装实例
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
- ››ASP.NET中获取用户控件中控件的ID
- ››ASP.NET中FileBytes写成文件并存档
赞助商链接