Code example for ColorMatrix

Methods: setScale

0
    return RGBFilter( r, g, b );
 
  } 
 
  ColorMatrixColorFilter RGBFilter( int r, int g, int b ) {
    ColorMatrix cm = new ColorMatrix();
    cm.setScale( r / 255f, g / 255f, b / 255f, 1 );
    return new ColorMatrixColorFilter( cm );
 
  } 
 
  public void CompatibleWith( double windowWidth, double windowHeight ) {
    int rWidth = (int) ( windowWidth / 3 );
    int rHeight = (int) ( rWidth / 250.0 * 150.0 );
    mCenterX = (int) windowWidth / 2;
    mCenterY = (int) windowHeight / 2;
    mOutR = mCenterX;
    mInR = mOutR - rHeight;
    int rX = mCenterX - rWidth / 2;
    int rY = mCenterY - mOutR;