Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
773 views
in Technique[技术] by (71.8m points)

image - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...