ImageActivity.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:letv 作者:
private Bitmap a(String str) throws IOException {
    int i = 1;
    Options options = new Options();
    options.inJustDecodeBounds = true;
    Uri parse = Uri.parse(str);
    InputStream openInputStream = getContentResolver().openInputStream(parse);
    if (openInputStream == null) {
        return null;
    }
    BitmapFactory.decodeStream(openInputStream, null, options);
    openInputStream.close();
    int i2 = options.outWidth;
    int i3 = options.outHeight;
    while (i2 * i3 > 4194304) {
        i2 /= 2;
        i3 /= 2;
        i *= 2;
    }
    options.inJustDecodeBounds = false;
    options.inSampleSize = i;
    return BitmapFactory.decodeStream(getContentResolver().openInputStream(parse), null, options);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号