Closed stefannikolei closed 6 years ago
please check dynamicSizing=true on the settings
i have not set dynamicSizing. Setting it to true results into displaying nothing.
this.cropperSettings = new CropperSettings(); this.cropperSettings.width = 250; this.cropperSettings.height = 250; this.cropperSettings.canvasWidth = 250; this.cropperSettings.canvasHeight = 250; this.cropperSettings.croppedWidth = this.cropperSettings.canvasWidth; this.cropperSettings.croppedHeight = this.cropperSettings.canvasHeight; this.cropperSettings.noFileInput = true; this.cropperSettings.cropperDrawSettings = new CropperDrawSettings(); this.cropperSettings.cropperDrawSettings.strokeColor = '#C41622'; this.cropperSettings.cropperDrawSettings.strokeWidth = 2;
Those are my settings
This is my Template
<img-cropper #myCropper [image]="data" [(settings)]="cropperSettings" [ngClass]="{hidden: !data.original}"></img-cropper>
Set it to true and add some sass/css to the canvas by giving it a class with cropperClass
:
this.cropperSettings.cropperClass = 'myCropper';
.myCropper {
display: block;
width: 100%;
height: 100%;
}
Is there a way to resize the width of the cropper?
I am only able to initially set the width and heights. I want to set this dynamically.