You have to add buttons to your template (.html file):
<button (click)="moveTop()">Move top</button>
<button (click)="moveRight()">Move right</button>
<button (click)="moveBottom()">Move bottom</button>
<button (click)="moveLeft()">Move left</button>
After that go to to your component (.ts file) and write next:
import { ImageTransform } from 'ngx-image-cropper';
translateH = 0;
translateV = 0;
transform: ImageTransform = {};
moveLeft() {
this.translateH = this.translateH - 5;
this.transform = {
...this.transform,
translateH: this.translateH
};
}
moveTop() {
this.translateV = this.translateV - 5;
this.transform = {
...this.transform,
translateV: this.translateV
};
}
moveRight() {
this.translateH = this.translateH + 5;
this.transform = {
...this.transform,
translateH: this.translateH
};
}
moveBottom() {
this.translateV = this.translateV + 5;
this.transform = {
...this.transform,
translateV: this.translateV
};
}