Android Bitmap: Convert transparent pixels to a color

前端 未结 2 1381
生来不讨喜
生来不讨喜 2021-01-01 16:35

I have an Android app that loads an image as a bitmap and displays it in an ImageView. The problem is that the image appears to have a transparent background; this causes so

2条回答
  •  情深已故
    2021-01-01 17:18

    You can loop through each pixel and check if it is transparent.

    Something like this. (Untested)

            Bitmap b = ...;
            for(int x = 0; x

提交回复
热议问题