AS3.0 图片变黑白 图片彩色变黑白代码

2015-08-18 15:20:13来源:作者:人点击

AS3.0 图片变黑白 图片彩色变黑白代码复制代码代码如下:import flash.filters.ColorMatrixFilter;//导入色彩滤镜var matrix:Array = [ 0.5,0.5,0.082,0,0,0.5,0.5,0.082,0,0,0.5,0.5,0.082,0,0,0,0,0,1,0 ];//定义色彩数组var colorMat:ColorMatrixFilter = new ColorMatrixFilter(matrix);//创建滤镜对象//添加鼠标事件image_mc.addEventListener(MouseEvent.MOUSE_OVER,over);image_mc.addEventListener(MouseEvent.MOUSE_OUT,out);image_mc.filters = [colorMat]; function over(e:MouseEvent):void{   image_mc.filters = [];} function out(e:MouseEvent):void{   image_mc.filters = [colorMat]; }

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台