Formats supported by BitmapFactory.decodeByteArray(…)

柔情痞子 提交于 2019-12-10 12:54:23

问题


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


回答1:


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

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.



来源:https://stackoverflow.com/questions/24333450/formats-supported-by-bitmapfactory-decodebytearray

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