ImageUtils.java 文件源码

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

项目:BBSSDK-for-Android 作者:
/**
 * 获取bitmap
 *
 * @param fd        文件描述
 * @param maxWidth  最大宽度
 * @param maxHeight 最大高度
 * @return bitmap
 */
public static Bitmap getBitmap(final FileDescriptor fd, final int maxWidth, final int maxHeight) {
    if (fd == null) {
        return null;
    }
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inJustDecodeBounds = true;
    BitmapFactory.decodeFileDescriptor(fd, null, options);
    options.inSampleSize = calculateInSampleSize(options, maxWidth, maxHeight);
    options.inJustDecodeBounds = false;
    return BitmapFactory.decodeFileDescriptor(fd, null, options);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号