Android Bitmap Pixel Get getPixelsMatrixFromBitmap(Bitmap bitmap)

Here you can find the source of getPixelsMatrixFromBitmap(Bitmap bitmap)

Description

get Pixels Matrix From Bitmap

License

Apache License

Declaration

public static int[][] getPixelsMatrixFromBitmap(Bitmap bitmap) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import android.graphics.Bitmap;

public class Main {
    public static int[][] getPixelsMatrixFromBitmap(Bitmap bitmap) {

        int[][] pixelMatrix = new int[bitmap.getWidth()][bitmap.getHeight()];

        for (int i = 0; i < bitmap.getWidth(); i++)
            for (int j = 0; j < bitmap.getHeight(); j++)
                pixelMatrix[i][j] = bitmap.getPixel(i, j);

        return pixelMatrix;

    }/*from   w  ww  . ja  v  a2  s  .  c  o m*/
}

Related

  1. getPixels(Bitmap bit)
  2. getPixels(Bitmap bit)