BitmapFactory.decodeByteArray(...)支持的格式 [英] Formats supported by BitmapFactory.decodeByteArray(...)

查看:586
本文介绍了BitmapFactory.decodeByteArray(...)支持的格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否已记录(或合理假设)

Is it documented (or reasonable to assume) that BitmapFactory.decodeByteArray(...) can be expected to recognize any of the image formats listed here?

推荐答案

是的,假设是合理的(如果您看一下AOSP的源代码,则要多一点). BitmapFactory的JNI本机方法位于BitmapFactory.cpp中.

Yes, it's reasonable to assume (a bit more so if you take a peek at the source code of AOSP). The JNI native methods for BitmapFactory are in BitmapFactory.cpp.

https://github.com/android/platform_frameworks_base/blob/master/core/jni/android/graphics/BitmapFactory.cpp

由于BitmapFactory.decodeByteArray()BitmapDrawable(InputStream)构造函数都最终调用doDecode(),并且由于从APK加载资源时使用了该构造函数,因此可以合理地假设功能是相同的.

Since both BitmapFactory.decodeByteArray() and the BitmapDrawable(InputStream) constructor end up calling doDecode(), and since this constructor is used when loading resources from the APK, it would be reasonable to assume that the capabilities are the same.

这篇关于BitmapFactory.decodeByteArray(...)支持的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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