获得Android的位图的RGBValues [英] Get RGBValues of Bitmap in Android

查看:191
本文介绍了获得Android的位图的RGBValues的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些问题,让Android中的位图的RGB值...
这是我在做什么:

I'm having some issues getting the RGB values of a bitmap in Android... This is what I'm doing:

int[] temp = new int[width*height];
bit.getPixels(temp, 0, width, 0, 0, width, height);

然而,颜色似乎不匹配典型RGB值。例如,一个白色像素将显示为-1,而对于它的RGB值是16777215(我越来越从这个网站的价值:的 http://www.shodor.org/stella2java/rgbint.html

还有一吨似乎并不适合普通的RGB值的负值。我的问题是,如果有一种方法可以转换为相对于Android的颜色整数其中通过getPixels()方法返回典型的RGB值。感谢您的帮助,让我知道,如果你有任何问题。

There's also a ton of negative values which don't seem to fit normal RGB values. My question is if there is a way to convert to the typical RGB values as opposed to the Android Color integers which the getPixels() method returns. Thanks for any help and let me know if you have any questions.

推荐答案

在一个无符号整数存储的值。

Store the value in an unsigned integer.

这篇关于获得Android的位图的RGBValues的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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