问题
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