cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

change croppersettings dynamically #212

Open kudsyf opened 7 years ago

kudsyf commented 7 years ago

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 ?

diannall commented 7 years ago

i would also like to change the cropperSettings dynamically...

ayya1987 commented 6 years ago

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.

MNorgren commented 6 years ago

@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!