问题描述
是否已记录(或合理假设) 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
.
由于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(...)支持的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!