作物形象与毕加索相一致。
16lz
2021-01-22
How can I crop image to square using picasso library on Android?
我如何在Android上使用毕加索的库来裁剪图像?
I need following: cat one and cat two
我需要跟随:猫1和猫2。
2 个解决方案
#1
1
The following project provides a lot of different transformations for Picasso
下面的项目为毕加索提供了许多不同的转换。
https://github.com/wasabeef/picasso-transformations
https://github.com/wasabeef/picasso-transformations
The one you are interested is named CropSquareTransformation
and you can apply it by using the following code
您感兴趣的这个名称叫做CropSquareTransformation,您可以使用下面的代码来应用它。
Picasso.with(mContext)
.load(R.drawable.demo)
.transform(transformation)
.transform(new CropSquareTransformation())
.into(holder.image);
You could add the dependency or copy and paste the classes you need.
您可以添加依赖项或复制并粘贴您需要的类。