置灰:
ColorMatrix matrix = new ColorMatrix();
matrix.setSaturation(0);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
控件.setColorFilter(filter);
效果:
setGray.PNG复原:
matrix.setSaturation(1);
ColorMatrix matrix = new ColorMatrix();
matrix.setSaturation(0);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
控件.setColorFilter(filter);
matrix.setSaturation(1);
本文标题:图片的置灰与复原
本文链接:https://www.haomeiwen.com/subject/ydpzvxtx.html
网友评论