Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create an array of Bitmap in android

Tags:

android

I wanna create an bitmap array. Is it possible? If yes, which is the way to declare the Bitmap array. and how to initialize it?

Thank you

like image 893
Jyosna Avatar asked Jun 16 '11 12:06

Jyosna


1 Answers

You could use an Arraylist :

ArrayList<Bitmap> bitmapArray = new ArrayList<Bitmap>();
bitmapArray.add(myBitMap); // Add a bitmap
bitmapArray.get(0); // Get first bitmap

or simply an Array of bitmap like :

Bitmap[] bitmapArray = new Bitmap[];

Nevertheless be careful with the size of your image. You will probably have some trouble if you try to store lot of big image.

like image 134
grunk Avatar answered Sep 20 '22 16:09

grunk