简体   繁体   English

ngx-image-cropper - 如何仅更改裁剪器的长度或宽度

[英]ngx-image-cropper - how change only the length or width of a cropper

In my angular 9 project I use ngx-image-cropper and it is working fine.在我的 angular 9 项目中,我使用 ngx-image-cropper,它工作正常。 This is my cropper code:这是我的裁剪代码:

 <image-cropper [imageChangedEvent]="imageChangedEvent" [imageURL]="imageUrl" [transform]="transform" [maintainAspectRatio]="true" [aspectRatio]="aspectRatio" [canvasRotation]="canvasRotation" (imageCropped)="imageCropped($event)" ></image-cropper>

I can use cropper in landscape, portrait and square shapes, also scale, rotate, flip, reset cropped image.我可以在横向、纵向和方形中使用裁剪器,还可以缩放、旋转、翻转、重置裁剪的图像。 But when I change cropper width the height changes depending on the width.但是当我改变裁剪器宽度时,高度会根据宽度而变化。 How can I change only the length or width of a cropper.如何仅更改裁剪器的长度或宽度。 enter image description here在此处输入图像描述

Try to change尝试改变

  [maintainAspectRatio]="false"

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

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