File? croppedImage = await ImageCropper.cropImage(
.......
androidUiSettings: AndroidUiSettings(lockAspectRatio: false,)这只允许调整大小,但不能保持特定的比例(我希望它是1:1)。
我几乎检查了所有的参数,但还是找不到。
我如何才能做到这一点?
发布于 2021-09-27 15:20:26
您可以使用如下所示的aspectRatio属性在图像裁剪器中保持1:1的纵横比
aspectRatio: CropAspectRatio(ratioX: 1.0, ratioY: 1.0),图像裁剪的完整代码
ImageCropper.cropImage(
sourcePath: originalImage.path,
aspectRatio: CropAspectRatio(ratioX: 1.0, ratioY: 1.0),
maxWidth: 1500, //optional if you want to control the width (max)
maxHeight: 1500, //optional if you want to control the height (max)
)https://stackoverflow.com/questions/69342539
复制相似问题