| | |
| | | |
| | | import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; |
| | | import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; |
| | | import com.bumptech.glide.load.resource.bitmap.TransformationUtils; |
| | | import com.bumptech.glide.util.Util; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | |
| | | @Override |
| | | protected Bitmap transform(BitmapPool pool, Bitmap toTransform, |
| | | int outWidth, int outHeight) { |
| | | return roundCrop(pool, toTransform); |
| | | //处理centercrop |
| | | Bitmap bitmap = TransformationUtils.centerCrop(pool, toTransform, outWidth, outHeight); |
| | | return roundCrop(pool, bitmap == null ? toTransform : bitmap); |
| | | } |
| | | |
| | | private static Bitmap roundCrop(BitmapPool pool, Bitmap source) { |