繁体   English   中英

如何使用Picasso库从中间而不是从顶部裁剪图片?

[英]How to use Picasso library to crop a picture not from the middle but from the top?

有一个方法cropCentre() -在中间进行cropCentre() 那么,有没有类似的方法,例如topCentre()

您总是可以对获取的Bitmap应用自定义转换:

Picasso.with(context).load(uri).transform(new Transformation() {
        @Override
        public Bitmap transform(Bitmap source) {
            ///Do what you want with bitmap
            return source;
        }

        @Override
        public String key() {
            return null;
        }
    }).into(imageView);

Picasso扩展picasso-transformations应该具有您需要的转换: picasso Transformations

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM