BitmapFactory德code的BMP图像 [英] BitmapFactory decode an BMP image

查看:144
本文介绍了BitmapFactory德code的BMP图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用这个code 从Android开发者博客下载如这个 BMP文件。 BitmapFactory.de codeStream始终返回null与Skia的返回false。

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.

我也用BitmapFactory.de codeByteArray的具有相同的结果尝试。
该框架支持BMP文件,所以我失去了什么?

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

感谢

编辑:在博客code适用于PNG和JPEG图像

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

推荐答案

好吧,我发现的这里,您需要与BufferedHttpEntity来包装HttpEntity。

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

BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);

这篇关于BitmapFactory德code的BMP图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆