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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -