使用Glide加载低分辨率图像

问题描述 投票:0回答:1

正如标题所示,有没有办法使用Glide加载低分辨率图像(可能是图像原始大小的一半)?我不知道它是否有意义但我基本上需要它,因此我的应用程序的数据用户可以最小化他们的数据消耗。我需要它作为Glide加载到视图中的最终图像(不是缩略图)。

android android-glide
1个回答
1
投票

我建议服务器将执行此操作,您还可以在加载时压缩和调整图像大小

RequestOptions reqOptions = new RequestOptions()
    .fitCenter() 
    .override(100, 100);

 Glide.with(context)
     .asBitmap()
     .apply(reqOptions)
     .load(imageUrl)
     .into(bitmapView);
© www.soinside.com 2019 - 2024. All rights reserved.