Custom Android Image Crop

后端 未结 3 975
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 17:28

i just want to share this piece of code that i wrote. I tried searching for a custom crop activity, but most of them leads to the default \"com.android.camera.action.CROP\"

3条回答
  •  孤城傲影
    2020-12-07 17:54

    I found a library which supports this: SimpleCropView from https://android-arsenal.com/details/1/2366. In general, I would not recommend it, its performance is far from the native android cropping apps.

    I've tried using it, and my thoughts are:

    • Really simple to implement in your app, took me about 5 minutes to get crop and rotation functionality working with my existing app

    • The re-sizing of the crop area is painfully slow, I wouldn't like my user to see it.

    UPDATE: In fact, I've found a really good solution as jdamcd/android-crop on Github: https://github.com/jdamcd/android-crop Summary:

    • Very simple to use in your app

    • Fast, since it uses the code from native gallery app

    • Customizable, if you want to spend some time playing with it. By default, it provides you with an Activity where you do the cropping. If you want to integrate it into your own activity, it will take a bit mor time. (For my project I would have liked to integrate it, and will do in the future, but for now a separate activity is enough).

    Hope this provides some insight!

提交回复
热议问题