Picasso的图片加载使用fit()方法
Picasso's image loading using fit() method
如果我使用 Picasso's fit()
方法从在线加载图像,我是否必须考虑使用 BitmapFactory.Options.inSampleSize
选项来减小图像的大小?我从其他 Whosebug 的问题 (Here) 中了解到:
You can also make use of the BitmapFactory.Options.inSampleSize
options to reduce the size of an image while it is loaded, rather than
loading in the entire image and then creating a small copy, which
wastes time and memory.
我必须在使用 fit()
之后再做吗?或者已经被 Picasso
?
完成了
非常感谢。
fit()
和对 resize()
(或 resizeDimen
)的显式调用都将在适当的时候自动使用 inSampleSize
。
因为 inSampleSize
应该是 2 的幂才能获得最佳性能和质量,因此您的图像至少需要是目标大小的两倍才能发生这种情况。
如果我使用 Picasso's fit()
方法从在线加载图像,我是否必须考虑使用 BitmapFactory.Options.inSampleSize
选项来减小图像的大小?我从其他 Whosebug 的问题 (Here) 中了解到:
You can also make use of the BitmapFactory.Options.inSampleSize options to reduce the size of an image while it is loaded, rather than loading in the entire image and then creating a small copy, which wastes time and memory.
我必须在使用 fit()
之后再做吗?或者已经被 Picasso
?
非常感谢。
fit()
和对 resize()
(或 resizeDimen
)的显式调用都将在适当的时候自动使用 inSampleSize
。
因为 inSampleSize
应该是 2 的幂才能获得最佳性能和质量,因此您的图像至少需要是目标大小的两倍才能发生这种情况。