簡體   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