Android Picasso load image to Bitmap variable cropping it to square -
i need load images uri bitmap variables , perform operation them togheter. need bitmaps squared images fixes size, scaled down , cropped. use code:
return picasso.with(c).load(imageuri).resize(size, size).get();
but, obviously, image resized without keep aspect ratio.
i want resize image these requirements:
- the smaller dimension (width or height) should equals
size
- the greater dimension should cropped
size
, keep image centered
the key using centerinside after resize. see link
picasso.with(c).load(imageuri).resize(size, size).centerinside().get()
Comments
Post a Comment