Get pixel values of a bitmap image in Android

末鹿安然 提交于 2019-12-23 02:07:45

问题


I need to develop an android application which do some image processing on the image input. For this, I need to get the pixel values of the bitmap in either an array or an object. Can anyone help me to grab the pixel-level details of a bitmap image.

Thanks !


回答1:


to get pixel array of bitmap

bitmap.getPixels(pixels, offset, stride, x, y, width, height);

every pixel/value in array will be represented as Color with ARGB value.




回答2:


if you want to get the value of on pixel do this int pixel = bitmap.getPixel(x, y);



来源:https://stackoverflow.com/questions/9960735/get-pixel-values-of-a-bitmap-image-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!