FoppyOmega
FoppyOmega

Reputation: 447

How do you tint a bitmap in Android?

I draw a bitmap onto a canvas using the following call:

_playerImage = BitmapFactory.decodeResource(getResources(), R.drawable.player);

How can I now tint this image white? I'm trying to make the image flash white like in top-scrollers when an enemy is hit by a bullet.

Do I need to use something other than BitmapFactory?

Upvotes: 20

Views: 22016

Answers (1)

Romain Guy
Romain Guy

Reputation: 98501

You can use a ColorFilter on your Paint when you draw the bitmap.

Upvotes: 46

Related Questions