Android本身的android.graphics.Bitmap实现
一般在Android使用图片,都会用到这个类,这个类中有一个函数:
getPixels(int[] pixels, int offset, int stride, int x, int y, int width, int height)
Returns in pixels[] a copy of the data in the bitmap.
功能和你要求的类似,只不过返回的是一位数组,转成二维数组应该不是问题吧。
使用是需注意,对于比较大的图片,你的操作很可能会比较占用内存,需要处理一下out of memory的exception。