读书人

图片放灰处理

发布时间: 2012-06-26 10:04:13 作者: rapoo

图片置灰处理
1.//像素过滤矩阵
2.public final static float[] BT_SELECTED = new float[] {
3. 0.308f, 0.609f, 0.082f, 0, 0,
4. 0.308f, 0.609f, 0.082f, 0, 0,
5. 0.308f, 0.609f, 0.082f, 0, 0,
6. 0, 0, 0, 1, 0
7.};
8.
9.Drawable myImage = res.getDrawable(R.drawable.h114);
10.myImage.mutate();
11.myImage.clearColorFilter();
12.myImage.setColorFilter(new ColorMatrixColorFilter(BT_SELECTED));

读书人网 >移动开发

热点推荐