Skip to content

Instantly share code, notes, and snippets.

@itoz itoz/gist:1074517

Created Jul 10, 2011
What would you like to do?
java android 縦長ビットマップをアニメーション用に指定サイズに切り出して配列に
public ArrayList<Bitmap> split(Drawable drawable, int width, int height)
// 縦長Drawableをビットマップに
Bitmap bitmapOrg = ((BitmapDrawable) drawable).getBitmap();
int masterHeight = bitmapOrg.getHeight();
int max = masterHeight / height;
_matrix = new Matrix();
for (int i = 0; i < max; i++) {
Bitmap splitBitmap = Bitmap.createBitmap(bitmapOrg, 0, (height * i), width, height, _matrix, true);
return _bmArray;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.