Skip to content

r00786/CircleImageCrop

Repository files navigation

CircleImageCrop

This is a Circle Image Cropper library in which you can move the image around the circle and crop the desired part

accessibility text accessibility text accessibility text accessibility text

In Project level build file

allprojects {
  	repositories {
  		...
  		maven { url 'https://jitpack.io' }
  	}
  }

In Module level build file

  dependencies {
          implementation ('com.github.r00786:CircleImageCrop:v1.0'){
                              exclude group: 'com.android.support'
              }
  }

How to Use

//implement the CircleCropActivity.CroppedImageCallbacks in your activity
public class MainActivity extends AppCompatActivity implements CircleCropActivity.CroppedImageCallbacks{

private CircleImageView ivCrop;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      ivCrop=findViewById(R.id.iv_crop);
  // Use this code to open Circle Crop first parameter is context second is bitmap to be cropped and third is whether you want           //grid lines or not
      CircleCropActivity.openCircleCropActivityWithBitmap(this, BitmapFactory.decodeResource(getResources(),R.drawable.photo),true);
  }


   //After saving your bitmap you will receive the bitmap in this method
  @Override
  public void setCroppedImage(Bitmap bitmap) {
          ivCrop.setImageBitmap(bitmap);

  }
}