Why Bitmap to Base64 String showing black background on webview in android?

后端 未结 1 1390
鱼传尺愫
鱼传尺愫 2020-12-03 11:37

I am using a code that combine to images into 1 by using canvas . I show that image to ImageView it looks fine. But when I try to show that into WebView it show background b

1条回答
  •  渐次进展
    2020-12-03 12:12

    The JPEG format does not support alpha transparency, which is why the transparent background becomes black when you convert your original image to JPEG.

    Use the PNG format instead:

     map1.compress(Bitmap.CompressFormat.PNG, 100, baos); 
    

    and

    String imgTag = "";   
    

    0 讨论(0)
提交回复
热议问题