Android: Make specific (green) color in background image transparent

后端 未结 3 1536
一生所求
一生所求 2020-12-11 14:21

i am writing an app for Android.

in an xml file defining layout I have a TabHost with 6 Tabs, which all have the same big background image \"settingsdlg.gif\".

3条回答
  •  有刺的猬
    2020-12-11 14:49

    You would have to change every green pixel into a transparent one. Here is an example: How to change colors of a Drawable in Android?

    However if there are green pixels in the middle of the image then you can have a problem. So the other way is, if your image has constant size and shape, to create a mask and use xfer modes to create a new image with transparent rounded corners.

提交回复
热议问题