Shushan
Shushan

Reputation: 53

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. 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

Upvotes: 1

Views: 3889

Answers (1)

LogicBlower
LogicBlower

Reputation: 1350

Try to change

  [maintainAspectRatio]="false"

Upvotes: 3

Related Questions