使用Android中的图像颜色代码更改布局背景

时间:2013-06-05 08:11:58

标签: android android-layout android-viewpager

我使用viewPager Gallery"Depth Page Transformation"使用animation我需要根据background设置imagebackground color应与image颜色匹配,这意味着它应从background color中选择image。有谁知道这个......请告诉我。

1 个答案:

答案 0 :(得分:0)

循环遍历所有像素的颜色数据并平均颜色值,忽略任何灰色或透明阴影。我相信这是微软基于最近的博客文章在Windows 7中所做的事情。

请参阅此博文:http://blogs.msdn.com/b/oldnewthing/archive/2011/12/06/10244432.aspx

此链接显示了Chrome如何选择主色也可能会有所帮助。 http://www.quora.com/Google-Chrome/How-does-Chrome-pick-the-color-for-the-stripes-on-the-Most-visited-page-thumbnails

找到Android的这个片段 http://forums.makingmoneywithandroid.com/android-development/406-%5Bhow-%5D-get-average-color-drawable-bitmap.html

相关问题