Arutha
Arutha

Reputation: 26498

Android image transparency

How can I make certain pixels of an DrawableBitmap transparent?

Upvotes: 5

Views: 13344

Answers (4)

user2164757
user2164757

Reputation:

.setAlpha(alpha)

alpha can range from 0 (fully transparent), and 255 (fully opaque).

Upvotes: 0

Tughi
Tughi

Reputation: 1093

Maybe this helps:

Bitmap buffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_4444);
buffer.eraseColor(Color.TRANSPARENT);

Upvotes: 5

david
david

Reputation: 1369

You can try to change the underlying Bitmap (if it is mutable) pixel with the setPixel method.

Upvotes: 0

Ally
Ally

Reputation: 2245

Android supports transparency on PNG files. So convert your bitmap to a PNG using an editor like GIMP and the work's done for you.

Upvotes: 0

Related Questions