繁体   English   中英

在 image_cropper 中扩大裁剪区域时裁剪比例发生变化 flutter

[英]crop ratio getting changed when expanding crop area in image_cropper flutter

How to lock aspect ratio when 1:1,4:3 or 16:9 crop aspect ratio select. When original ratio selected make aspect ratio unlock.

它在 iOS 中工作正常,但在 android 平台中出现问题。

这是我用过的代码。

  val = (await ImageCropper.cropImage(
  sourcePath: pickedFile!.path,
  compressQuality: 100,
  maxHeight: 700,
  maxWidth: 700,
  compressFormat: ImageCompressFormat.jpg,
  androidUiSettings: AndroidUiSettings(
      toolbarColor: ColorConstants.primaryColor,
      toolbarWidgetColor: ColorConstants.customBlackColor,
      lockAspectRatio: false,
      toolbarTitle: "Wood",
      activeControlsWidgetColor: ColorConstants.primaryColor),

  iosUiSettings: IOSUiSettings(
      resetButtonHidden: false,
      aspectRatioLockEnabled: false,
      rotateButtonsHidden: false,
      rotateClockwiseButtonHidden: false)))!;

对于 android,您需要将lockAspectRatio设置为true 这是默认值。 您将其设置为false

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM