我试图从URL中加载一张分辨率较高的大型图片(3225x4800)到Glide中,供一家报社使用。我想要加载的图片是这张高分辨率图片。
String url = "http://www.businessweekmindanao.com/content/wp-content/uploads/2015/10/fitness-and-wellness-poster-final.jpg";
Glide.with(getActivity()).load(url).asBitmap().into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
imageView.setImageBitmap(resource);
}
});
我正在使用Mike Ortiz的TouchImageView,它是从这里提供的解决方案中获取的:https://github.com/MikeOrtiz/TouchImageView/issues/135。但似乎它只能用于小分辨率图像,并且无法加载高质量图像。
有一个备选方案我在stackoverflow上尝试过:Android: not displayed ImageView with UIL and TouchImageView,其中修改了Mike库的onMeasure()方法。它可以与以下一起使用:
Glide.with(getActivity()).load(url)
.into(imageViewPreview);
问题是它以非常低的分辨率加载图像。
是否有一种使用Glide和TouchImageView加载高分辨率图像(例如7480x3740)的方法?我该怎么做?