//改變圖片的亮度方法 0--原樣 >0---調亮 <0---調暗 private void changeLight(ImageView imageView, int brightness) { ColorMatrix cMatrix = new ColorMatrix();...
//改變圖片的亮度方法 0--原樣 >0---調亮 <0---調暗 private void changeLight(ImageView imageView, int brightness) { ColorMatrix cMatrix = new ColorMatrix(); cMatrix.set(new float[] { 1, 0, 0, 0, brightness, 0, 1, 0, 0, brightness,// 改變亮度 0, 0, 1, 0, brightness, 0, 0, 0, 1, 0 }); imageView.setColorFilter(new ColorMatrixColorFilter(cMatrix)); }