裁剪和旋转捕获的图片 Xamarin.Android 和 Xamarin.iOS



任何人都知道可以使用Android或iOS智能手机拍照的库,然后提供裁剪或旋转此图像的视图(因此,没有本机预览(

我与pcl/xamarin.android/xamarin.ios(不是xamarin.form(一起工作

您可以使用ffimageloading裁剪和旋转图像。尝试在图像中添加捏/滑动手势识别器,当此事件触发时,请使用旋转转换来旋转图像:

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

和农作物的作物转化为作物图像:

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

更多详细信息代码可以在每个平台或PCL的示例中找到。但这只为您提供代码,您应该创建自己的界面以完成用户的交互。

您也可以尝试以下其他库,例如:

https://github.com/stormlion227/imagecropper.formshttps://github.com/muak/xamarin.plugin.imageedit

最新更新