Open vistajess opened 6 years ago
The cropper object has a reset
function available
cropper object has not reset by using this function clear() { this.data1 = {}; }
plz help me to Reset canvas in anotherway
I found an answer to this (to reset the canvas. you already know how to clear the cropped data):
In the component.html use #cropper like this:
<img-cropper #cropper [image]="data1" [settings]="cropperSettings" (onCrop)="cropped($event)">
In component.ts include these lines: export class myComponent implements OnInit { @ViewChild('cropper', undefined) cropper:ImageCropperComponent; constructor () {} clear () { this.cropper.reset(); } } @
I am using the reset function as well as the resizeCanvas function, but the cropper size isn't changing. Anyone find how to do this?
thanks @savita-turner
I experimented on the
plunker
, I madeclear
function to reset to initial state:clear() { this.data1 = {}; }
the image cropper data resets but the canvas content is still there.