文章目录
1
2
3
4
5
6
7
8
9
10
11
private function convertToGrayscale(image:DisplayObject):void
{
var matrix:Array = [0.3, 0.59, 0.11, 0, 0,
0.3, 0.59, 0.11, 0, 0,
0.3, 0.59, 0.11, 0, 0,
0, 0, 0, 1, 0];
var grayscaleFilter:ColorMatrixFilter = new ColorMatrixFilter(matrix);
var filters:Array = image.filters;
filters.push(grayscaleFilter);
image.filters = filters;
}

♦ 本文固定连接:http://gsgundam.com/2012-11-27-function-image-turn-to-grayscale/

♦ 转载请注明:GSGundam 2012年11月27日发布于 GSGUNDAM砍柴工

友荐云推荐