Answer the question
In order to leave comments, you need to log in
Android Studio: how to load bitmap as Marker using picasso or fresco?
Good afternoon.
There is a common error in picasso when working with target: onBitmapLoaded does not fire.
How else can you use the loaded bitmap without attaching it to the imageView?
When working with fresco, I used the image loading method via ImagePipeline and dataSource.subscribe(new BaseBitmapDataSubscriber()), CallerThreadExecutor.getInstance());
, but without success
How to load the bitmap not in the imageView, but for further use in the code?
Thanks
Answer the question
In order to leave comments, you need to log in
Well frescolib makes it pretty easy to do this. Just read the docs: frescolib.org/docs/using-image-pipeline.html
While I made a crutch on Picasso using transform:
ImageView imageview = new ImageView(MainActivity.this);
Picasso.with(getApplication())
.load(url)
.transform(new CropSquareTransformation())
.into(imageview);
public class CropSquareTransformation implements Transformation {
@Override public Bitmap transform(Bitmap source) {
Log.w("MY", "Bitmap transform(Bitmap source)");
int size = Math.min(source.getWidth(), source.getHeight());
int x = (source.getWidth() - size) / 2;
int y = (source.getHeight() - size) / 2;
Bitmap result = Bitmap.createBitmap(source, x, y, size, size);
MY_FUNCTION(result);
if (result != source) {
source.recycle();
}
return result;
}
@Override public String key() { return "square()"; }
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question