angular2-img-cropper
angular2-img-cropper copied to clipboard
change croppersettings dynamically
i need to change the predefined cropper settings based on a condition, i tried the following
this.cropper.cropper = new ImageCropper(this.cropperImageSettings);
this.cropperImage.cropper.prepare(this.canvas);
but am getting blank canvas ! any idea ?
i would also like to change the cropperSettings dynamically...
Please try this,
this.cropper.cropper = new ImageCropper(this.cropperImageSettings); this.cropper.cropper.prepare(this.cropper.cropcanvas.nativeElement); this.cropper.setImage(image);
its working for me.
@ayya1987 - That fixed it for me, thanks!
It would be nice to be able to toggle some settings without the need to reset the image (causes a flicker and resets the cropper area). But this work around will do for now.
Thanks again!