如何使用LightingColorFilter 使图像从暗到亮 [英] how to use the LightingColorFilter to make the image form dark to light

查看:47
本文介绍了如何使用LightingColorFilter 使图像从暗到亮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想给图片加光,我想用LightingColorFilter

I want to add light of the image, I want to use LightingColorFilter

LightingColorFilter lcf = new LightingColorFilter( mul, add); 
imageView.setColorFilter(lcf);

但是我不知道如何调整mul, add,能不能给个链接或者代码或者参数来调整图片的亮度?

but I don't know how to adjust mul, add, can you give some link or code or parameters to adjust the light of the image?

谢谢

推荐答案

整数值是颜色(你可能想仔细看看这里 http://developer.android.com/reference/android/graphics/Color.html)
使用了 4 个字节,一个用于 alpha,一个用于红色,一个用于绿色,一个用于蓝色范围 - 每一个从 0 到 255(十六进制 0 到 FF)

The integer values are colours (you may want to have a closer look here http://developer.android.com/reference/android/graphics/Color.html)
4 Bytes are used, one for alpha, one for red, one for green, one for blue range - every single from 0 to 255 (hex 0 to FF)

所以十六进制的颜色看起来像

so the colour in hex looks like

0 x 00     00   00    00
    alpha  red  green blue

如果要将例如红色设置为零,请使用

If you want to set for example red to zero, use

mul: 0xFF00FFFF
add: 0x00000000

如果你想强制蓝色全开,使用

If you want to force blue to be full-on, use

mul: 0xFFFFFFFF
add: 0x000000FF 

这篇关于如何使用LightingColorFilter 使图像从暗到亮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆