How can I specify the bitmap format (e.g. RGBA_8888) with BitmapFactory.decode*()?

前端 未结 2 2051
耶瑟儿~
耶瑟儿~ 2021-01-02 02:41

I\'m making several calls to BitmapFactory.decodeFile() and BitmapFactory.decodeResource(), and I\'d like to specify the format the bitmaps are dec

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 03:08

    When you have bitmap you can call copy method on it specifying BitmapConfig which is basically what you want. http://developer.android.com/reference/android/graphics/Bitmap.html#copy(android.graphics.Bitmap.Config,boolean)

提交回复
热议问题