置灰:
ColorMatrix matrix = new ColorMatrix();
matrix.setSaturation(0);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
控件.setColorFilter(filter);
效果:
复原:
matrix.setSaturation(1);
ColorMatrix matrix = new ColorMatrix();
matrix.setSaturation(0);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
控件.setColorFilter(filter);
matrix.setSaturation(1);