BitmapUtils.java 文件源码

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

项目:boohee_v5.6 作者:
public static Options getBitmapOptions(byte[] bArr) {
    Options options = new Options();
    options.inJustDecodeBounds = true;
    BitmapFactory.decodeByteArray(bArr, 0, bArr.length, options);
    int ceil = (int) Math.ceil((double) (options.outWidth / UMImage.MAX_WIDTH));
    int ceil2 = (int) Math.ceil((double) (options.outHeight / UMImage.MAX_HEIGHT));
    if (ceil2 <= 1 || ceil <= 1) {
        if (ceil2 > 2) {
            options.inSampleSize = ceil2;
        } else if (ceil > 2) {
            options.inSampleSize = ceil;
        }
    } else if (ceil2 > ceil) {
        options.inSampleSize = ceil2;
    } else {
        options.inSampleSize = ceil;
    }
    options.inJustDecodeBounds = false;
    return options;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号