cstefanache / angular2-img-cropper

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

Make the canvas white or hide it until image is loaded #142

Closed laura2489 closed 7 years ago

laura2489 commented 7 years ago

This cropper works very well for me, but i cannot make the canvas white or hide it until an image is uploaded. Please help me: image

cstefanache commented 7 years ago

I am thinking about having emptyClass and class defined as settings on the CropperSettings that will be assigned on the Canvas native element - will this work for you?

laura2489 commented 7 years ago

Hope so. I'll have to try it to know for sure, but it sounds like a good idea.

cstefanache commented 7 years ago

Fixed by adding:

this.cropperSettings1.cropperClass = 'custom-class'; this.cropperSettings1.croppingClass = 'cropping';

You can hide the cropper as such: .custom-class { visibility: hidden; }

.cropping { visibility: visible; }

sorakthun commented 7 years ago

@cstefanache I set the class and styled it as your instruction. But it doesn't work.

kagutagu commented 7 years ago

@sorakthunly you have to place the class inside your main stylesheet, not your component stylesheet.