【发布时间】:2021-11-08 11:36:00
【问题描述】:
下面的照片是我想要裁剪的方式。但我只看到如何裁剪成矩形。请原谅我的写作格式。这是我第一次询问堆栈溢出问题。 这是我的图片裁剪代码
Future<File> cropSquareImage(File imageFile) async =>
await ImageCropper.cropImage(
sourcePath: imageFile.path,
aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1),
aspectRatioPresets: [CropAspectRatioPreset.square],
compressQuality: 70,
compressFormat: ImageCompressFormat.jpg,
androidUiSettings: androidUiSettingsLocked(),
iosUiSettings: iosUiSettingsLocked(),
);
照片记录
【问题讨论】:
-
“但我只看到如何裁剪成矩形。” - 然后发布代码
-
@pskink 抱歉我已编辑
-
你有 CropStyle 可以使用的枚举
标签: flutter flutter-image