Crop and rotate a captured picture Xamarin.Android & Xamarin.iOS

后端 未结 1 1200
暗喜
暗喜 2021-01-23 06:54

Anyone knows a library that can take a picture with an Android or iOS smartphone and then offer a view to crop or rotate this image (so, without the native preview)

I wo

相关标签:
1条回答
  • 2021-01-23 07:41

    You can use FFImageLoading to crop and rotate your images. Try to add pinch/swipe gesture recognizer to your images, when this event fires use the rotate transformation to rotate the image:

    public RotateTransformation(double degrees, bool ccw, bool resize)
    {
        ...
    }
    

    and the Crop Transformation to crop images:

    public CropTransformation(double zoomFactor, double xOffset, double yOffset, double cropWidthRatio, double cropHeightRatio)
    {
        ...
    }
    

    More details code can be found in the sample for each platform or PCL. But this only offers you the code, you should create your own interface to complete the user's interaction.

    Also you can try other libraries like:

    https://github.com/stormlion227/ImageCropper.Forms https://github.com/muak/Xamarin.Plugin.ImageEdit

    0 讨论(0)
提交回复
热议问题