簡體   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