BitmapFactory decode an BMP image

被刻印的时光 ゝ 提交于 2020-01-04 14:12:11

问题


I am using this code from android developer blog for downloading a BMP file like this one. BitmapFactory.decodeStream always returns null with skia returning false.

I've also tried using BitmapFactory.decodeByteArray with same result. The framework supports BMP files, so what am i missing?

Thanks

EDIT: The code in the blog works for PNG and JPEG images.


回答1:


Okay, i found here, you need to wrap the HttpEntity with a BufferedHttpEntity.

BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);


来源:https://stackoverflow.com/questions/5886583/bitmapfactory-decode-an-bmp-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!