ImageView의 밝기, 대비, 채도 및 색조를 변경하고 있습니다. 나는 그것에 대해 많이 조사했다.ImageView에서 두 개의 ColorMatrix를 병합하거나 동시에 두 개 이상의 ColorMatrix를 적용하십시오.
ColorMatrix와 작동하는 코드가 있습니다.
는 [1] 밝기를 들어 ColorMatrix 제대로 작동
float brightness = (-50F * 1.5F);
ColorMatrix cmB = new ColorMatrix();
cmB.set(new float[] { 1, 0, 0, 0, brightness,
0, 1, 0, 0,brightness,
0, 0, 1, 0, brightness,
0, 0, 0, 1, 0 });
myImageView.setColorFilter(new ColorMatrixColorFilter(cmB));
같은 몇 가지 일이다.
는 [2]대비를 ColorMatrix도 제대로 작동 뭔가 다른이다.
그러나이 ColorMatrix는 모두 입니다. 마지막으로 적용한 ColorMatrix의 효과를 의미합니다 ImageView의 장면입니다. 정확히 수행하기 때문에 은 적용된 이전의 효과를 제거합니다. ColorMatrix 및 설정은 마지막으로 ColorMatrix를 적용합니다.
이제 ColorMatrix를 모두 동시에 병합하거나 혼합하고 싶습니다. Brightnrs/Saturation/Hue의 ColorMatrix 효과에 Contrast의 ColorMatrix를 적용하고 싶습니다.