// 颜色矩阵
private float[] colorArray = { 1, 0, 0, 0, 0, //R决定红色
0, 1, 0, 0, 0, //G决定绿色
0, 0, 1, 0, 0, //B决定蓝色
0, 0, 0, 1, 0 };//A决定了透明度,如果有第五列决定偏移量
ColorMatrix matrix = new ColorMatrix();
matrix.setSaturation(0);// 彩色0——>1增强
//matrix.set(colorArray); //设置颜色矩阵
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
imageview.setColorFilter(filter);
有图有真相,上图
转载于:https://my.oschina.net/u/1471093/blog/390329