glide 获取在线网络图片的宽和高。
String url = "http://or4824vcd./pexels-photo-236960.jpeg";Glide.with(getApplicationContext()).load(url).asBitmap()//强制Glide返回一个Bitmap对象.into(new SimpleTarget<Bitmap>() {@Overridepublic void onResourceReady(Bitmap bitmap, GlideAnimation<? super Bitmap> glideAnimation) {int width = bitmap.getWidth();int height = bitmap.getHeight();Log.e("width_height", "width " + width + "--------height " + height);}});
运行程序得出图片的宽和高。
如果觉得《Glide获取网络图片宽和高》对你有帮助,请点赞、收藏,并留下你的观点哦!