Here you can find the source of getPixels(Bitmap bit)
public static int[] getPixels(Bitmap bit)
//package com.java2s; import android.graphics.Bitmap; public class Main { public static int[] getPixels(Bitmap bit) { int w = bit.getWidth(), h = bit.getHeight(); int pixels[] = new int[w * h]; bit.getPixels(pixels, 0, w, 0, 0, w, h); return pixels; }/* ww w . j av a 2s . co m*/ }