angular-cropperjs icon indicating copy to clipboard operation
angular-cropperjs copied to clipboard

Can not preview the image.

Open susheelbanyal opened this issue 7 years ago • 2 comments

I Can not preview the image. its style is always 0 or none. Can you please let me know how to show the preview and get the cropped image? I go this in html for preview. <img src="image_03.jpg" width="1024" height="576" style="display: block; width: 0px; height: 0px; min-width: 0px !important; min-height: 0px !important; max-width: none !important; max-height: none !important; transform: none;">

susheelbanyal avatar Dec 21 '17 09:12 susheelbanyal

I just get HTMLCanvasElement with getCropperCanvas method, and then convert it to DataURI that can be previewed in image tag. Looks like this:

let result: HTMLCanvasElement = this.angularCropper.cropper.getCroppedCanvas({
            aspectRatio: 1,
            width: 400,
            height: 400
        });
return result.toDataURL();

MusicalEcho avatar Jan 25 '18 12:01 MusicalEcho

How to make responsive?? I want when I move the cropped area it should reflect instantly on preview. In example on top right side, that thing I want. How I can achieve that?

vinayistar avatar Feb 23 '18 06:02 vinayistar