1

I want the user to upload his profile picture but I want to force him to crop it before .

How can I do that ?

like this

I try to do it from scratch but it will take a lot of time i guess , Is there any library can do the job for me ?

ArolaAb
  • 297
  • 3
  • 12

2 Answers2

0

You can use Picasso library. It is very easy to use.

For example:

 Picasso.with(mContext)
  .load(url)
  .centerCrop()
  .resize(yourImageView.getMeasuredWidth(),yourImageView.getMeasuredHeight())
  .error(R.drawable.error)
  .placeholder(R.drawable.blank_img)
  .into(yourImageView);
Ratul Bin Tazul
  • 2,121
  • 1
  • 15
  • 23
0

There are a few way to do, First and suggested way use library or handle it with android intent

com.android.camera.action.CROP

at your own

I'v use this library for a while and it's great

https://github.com/ArthurHub/Android-Image-Cropper

A Dev
  • 82
  • 1
  • 10