Showing posts with label bitmap. Show all posts
Showing posts with label bitmap. Show all posts
Tuesday, January 28, 2014
Slice Bitmap Image In Android
With this simple function you can slice one bitmap image and return array with the sliced images. Just pass in the bitmap you want to slice and number of rows and columns you want it sliced into.
public static ArrayList GetSplittedBitmap(Bitmap picture, int numRow, int numColumn){
ArrayList imgs = new ArrayList();
int pieceHeight = picture.getHeight()/numRow;
int pieceWidth = picture.getWidth()/numColumn;
for(int i=0; i for(int j=0; j imgs.add(Bitmap.createBitmap(picture,j*pieceWidth,i*pieceHeight,pieceWidth,pieceHeight));
}
}
return imgs;
}
Read more »
public static ArrayList
ArrayList
int pieceHeight = picture.getHeight()/numRow;
int pieceWidth = picture.getWidth()/numColumn;
for(int i=0; i
}
}
return imgs;
}
Subscribe to:
Posts (Atom)