Android 通过图片url获取图片的宽高

    //获取图片真正的宽高
        Glide.with(mContext).asBitmap().load(list.get(0).imagePath).into(new SimpleTarget<Bitmap>() {
        @Override
        public void onResourceReady(Bitmap bitmap, Transition<? super Bitmap> transition) {
            int width = bitmap.getWidth();
            int height = bitmap.getHeight();
            LogUtil.d("width " + width); //900px
            LogUtil.d("height " + height); //500px
        }
    });

猜你喜欢

转载自blog.csdn.net/yechaoa/article/details/80041377
今日推荐