Convert immutable Bitmap file to mutable Bitmap

前端 未结 2 966
感动是毒
感动是毒 2021-01-17 10:57

A:

 Bitmap immutableBmp= BitmapFactory.decodeResource(getApplicationContext().getResources(),R.drawable.sample);
 mutableBitmap=immutableBmp.copy(Bitmap.Conf         


        
相关标签:
2条回答
  • 2021-01-17 11:20

    Found this:

    Bitmap bmp_Copy = bmp_Base.copy(Bitmap.Config.ARGB_8888,true);
    
    0 讨论(0)
  • 2021-01-17 11:25

    I have found the problem! All of the 3 methods above are working, there was a problem with the resolution of my image, so I thought the code didn't work and it was not mutable but I was wrong. Here is another solution to change immutable image to mutable.

    BitmapFactory.decodeResource returns a mutable Bitmap in Android 2.2 and an immutable Bitmap in Android 1.6

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