Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clean up a bitmap?

I'm creating a new empty transparent Bitmap and making some modifications to it.

Is there a way to clean up this (make transparent and empty again) without creating new instance of Bitmap?

UPDATE: Thanks for your help. I have found answer.

// Fills the bitmap's pixels with the specified Color. 
bitmap.eraseColor(somecolor);
like image 863
Zheka Avatar asked Jun 12 '11 05:06

Zheka


1 Answers

Try this:

myBitmap.eraseColor(android.graphics.Color.TRANSPARENT);

The constant int value of TRANSPARENT is 0x00000000.

like image 50
Shumon Saha Avatar answered Sep 27 '22 22:09

Shumon Saha