decodeFile(String pathName) 从一个pathName路径解析图片
decodeFile(String pathName, BitmapFactory.Options opts) 同上,包含opts
decodeFileDescriptor(FileDescriptor fd)
decodeFileDescriptor(FileDescriptor fd, Rect outPadding,BitmapFactory.Options opts)decodeResource(Resources res, int id, BitmapFactory.Options opts) 从android资源文件夹解析图片
decodeResource(Resources res, int id) 同上,不包含opts参数
decodeResourceStream(Resources res, TypedValue value, InputStream is, Rect pad, BitmapFactory.Options opts)
decodeStream(InputStream is) 从is流中解析图片
decodeStream(InputStream is, Rect outPadding, BitmapFactory.Options opts) 同上
如上生成位图的方法decodeResource..(…)这种不建议使用,因为种方生成位图时会在java层做一些操作,这样内存消耗更多,而decodeFile(。。。)方法直接操作底层内存消耗更少,防止OOM这个是非常关键的一步。使用时注意查看源码非常清楚二者的使用区别
