0

This question have been asked a few times before, but I have not seen a really good answer.

A couple of years ago I was doing some 2D game programming in DirectX (c++) but also in Java (awt, swing). In those days is was kind of fundamental to have a specific masking color on all bitmaps that could be used for masking and achieve transparency. Back in those days you usually used GIF or JPG.

Now I'm learning Android, and I cannot find out a really good solution on how to do the same. The code I find are not working e.g: Masking color android

Now, is masking in this way really not possible in Android? To me with my previous experiences, this technique is fundamental. Are you supposed to use PNG with transparency supported instead?

Thanks, Mattias

Community
  • 1
  • 1
user1578293
  • 215
  • 2
  • 10

1 Answers1

0

You might be able to use PorterDuff to achieve what you are looking for. There are a few questions on SO which are similar to your problem like: Replace specific color in bitmap with transparency and Erase bitmap parts using PorterDuff mode which should give you a starting point.

Community
  • 1
  • 1
Morrison Chang
  • 11,691
  • 3
  • 41
  • 77