Search code examples
imageandroid-activityandroid-cameracropxamarin

Portable Crop Image Activity for Xamarin.Android (Monodroid / Mono for Android)


I am looking for a portable crop image activity to use inside my Xamarin.Android application. Something similar to this one written in Java: https://github.com/lvillani/android-cropimage.

I think this is necessary for those Android devices which do not have the default com.android.camera.action.CROP intent action implemented.

try {
    // Call the standard crop action intent (the user device may not support it).
    Intent cropIntent = new Intent ("com.android.camera.action.CROP");
    ...
    Activity.StartActivityForResult(cropIntent, ...);
} catch (ActivityNotFoundException ex) {
    // Call a custom portable crop image activity here.
}

Finally, are there any open libraries which I could use to implement the presented behaviour?


Solution

  • Yes, there is one (disclaimer: author here)

    cropimage-xamarin