问题
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 work with PCL / Xamarin.Android / Xamarin.iOS (Not Xamarin.Form)
回答1:
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
来源:https://stackoverflow.com/questions/50061890/crop-and-rotate-a-captured-picture-xamarin-android-xamarin-ios