简体   繁体   English

在Android中获取位图图像的像素值

[英]Get pixel values of a bitmap image in Android

I need to develop an android application which do some image processing on the image input. 我需要开发一个Android应用程序,它对图像输入进行一些图像处理。 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 ! 谢谢 !

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. 数组中的每个像素/值将表示为具有ARGB值的颜色。

如果你想获得on像素的值,请执行此操作int pixel = bitmap.getPixel(x,y);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM