Converting input stream into bitmap

后端 未结 2 1867
终归单人心
终归单人心 2020-12-05 01:50

I have problems converting a input stream from web into bitmap. Problem occurs only when input image type is .BMP (bitmap). In that case: bitmapFactory.decodeStream

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 02:46

    Here is a one-line answer

    val bitmap = BitmapFactory.decodeStream(inputStream)
    

    Returns a Bitmap

提交回复
热议问题