使用 WebService 图像的 DecodeByteArray 始终为 null

发布于 2024-09-29 00:30:10 字数 242 浏览 1 评论 0原文

我正在尝试做的事情是:

我正在调用一个向我发送回图像的 WebService。 我从 entity.getContent() 方法获取它。

此外,在我的代码中,我尝试使用 de BitmapFactory.decodeByteArray(myImage, 0, myImage.lenght) 但它返回给我的位图始终为 null

有人有想法吗?

There what I am trying to do :

I am calling a WebService that send me back an image.
I get it from the entity.getContent() method.

Further in my code I try to use de BitmapFactory.decodeByteArray(myImage, 0, myImage.lenght) but the Bitmap that it returns me is always null

Does someone have an idea ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

原谅我要高飞 2024-10-06 00:30:10

当无法从该数组解码图像时,decodeByteArray 返回 null,您可能以 BitmapFactory 无法理解的格式获取图像。

decodeByteArray returns null when the image cannot be decoded from that array, you are probably getting the image in a format that BitmapFactory doesnt understand.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文