改变Android的色彩亮度 [英] change color brightness in android

查看:219
本文介绍了改变Android的色彩亮度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变色彩亮度

我实现了这个...

<$p$p><$c$c>Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200);

这会改变我的设备的亮度在黑白与白模式。

像上面的图片,我可以改变亮度,但我怎么能放弃颜色?
有没有我不知道任何其他的参数?


解决方案

这可以通过使用类型TYPE_SYSTEM_ALERT的窗口完成。
这个想法是,甚至服务可以有一个窗口;所以你可以使用一个服务,这使得视图和一个视图和布局PARAMS调用窗口管理#addView()。你的情况,认为只会有一个alpha值的背景颜色。你可以用不同的布局PARAMS实验,以达到所需的效果。

这也是聊天的头如何Facebook的工作。看看这个链接了解更多有关的实施细则: http://www.piwai.info/chatheads-基础/ 这将给你如何去实现这种类型的屏幕叠加的想法。

I want to change brightness in color

I implemented this...

Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200);

this will change my device's brightness in black&white mode.

like above images, I can change brightness but how can I give color? Is there any other parameter which I don't know?

解决方案

This can be accomplished using windows of type TYPE_SYSTEM_ALERT. The idea is that even services can have a Window; so you can use a service, which makes a view and call WindowManager#addView() with a view and layout params. In your case, the view will just have a background color with an alpha value. You can experiment with different layout params to achieve the required effect.

This is also how facebook chat heads works. Check out this link to know more about the implementation details: http://www.piwai.info/chatheads-basics/ This will give you an idea on how to go about implementing this type of screen overlay.

这篇关于改变Android的色彩亮度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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