您的位置:首页 > 其它

5.Glide使用之图片调整大小和缩放

2017-05-02 18:30 344 查看
通常来讲,这是最佳的如果您的服务器提供的图像是你需要准确的尺寸,这是一个完美的带宽、内存消耗和图像质量之间的平衡。

override(horizontalSize, verticalSize)

Glide
.with(context)
.load(UsageExampleListViewAdapter.eatFoodyImages[0])
.override(600, 200) // resizes the image to these dimensions (in pixel). does not respect aspect ratio
.into(imageViewResize);


CenterCrop()

Glide
.with(context)
.load(UsageExampleListViewAdapter.eatFoodyImages[0])
.override(600, 200) // resizes the image to these dimensions (in pixel)
.centerCrop() // this cropping technique scales the image so that it fills the requested bounds and then crops the extra.
.into(imageViewResizeCenterCrop);


FitCenter()

Glide
.with(context)
.load(UsageExampleListViewAdapter.eatFoodyImages[0])
.override(600, 200)
.fitCenter()
.into(imageViewResizeFitCenter);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  图片