zoukankan      html  css  js  c++  java
  • 将显示对象变成黑白

    //显示对象变成彩色
    private function applyGrayToColour(child:DisplayObject):void {
    var matrix:Array = [];
    matrix = matrix.concat([1,0,0, 0, 0]); // red
    matrix = matrix.concat([0,1,0, 0, 0]); // green
    matrix = matrix.concat([0,0,1, 0, 0]); // blue
    matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha
    applyFilter(child, matrix);
    }

    //显示对象变成黑白
    private function applyGray(child:DisplayObject):void {
    var matrix:Array = [];
    matrix = matrix.concat([0.3086, 0.6094, 0.0820, 0, 0]); // red
    matrix = matrix.concat([0.3086, 0.6094,0.0820, 0, 0]); // green
    matrix = matrix.concat([0.3086, 0.6094, 0.0820, 0, 0]); // blue
    matrix = matrix.concat([0, 0, 0, 0.8, 0]); // alpha
    applyFilter(child, matrix);
    }

  • 相关阅读:
    常用命令
    经典算法
    框架
    计算机网络
    设计模式
    JVM
    数据库
    多线程
    Java中HashMap的底层实现原理
    构建大小顶堆
  • 原文地址:https://www.cnblogs.com/actionkong/p/3586786.html
Copyright © 2011-2022 走看看