如何将cropperjs裁剪区域设置为圆圈。 我使用angular / typescript和ngx-img模块。
这是我的component.html代码:
<ngx-img (onSelect)="imgEditorOnSelect($event)"
(onReset)="imgEditorOnReset()"
[config]="img_editor_config">
</ngx-img>
我的component.ts代码:
ngOnInit() {
/**
* configuracion para el cropperjs
* https://fengyuanchen.github.io/cropperjs/
*/
this.img_editor_config = {
crop: [{ ratio: 2 / 3, viewMode: 3 }]
}
}