aez
aez

Reputation: 2396

ArrayList<boolean[]> to Bitmap, best way?

What is an efficient way (in terms of memory and cpu) to convert an ArrayList<boolean[]> or a boolean[][] into a Bitmap?

Does this way change if we know that the Bitmap must be modified or appended later?

Upvotes: 0

Views: 302

Answers (1)

kabuko
kabuko

Reputation: 36302

Your best bet is probably to convert your boolean[][] to an int[] and use setPixels. This is especially beneficial if you're going to do many pixel-level modifications later (just re-use the int[] and call setPixels again).

Upvotes: 1

Related Questions