I do as an example:
<Dropzone onDrop={this.handleDrop} disableClick style={{ width: '250px', height: '250px' }}> <AvatarEditor ref={this.refAvatar} image={this.state.image} borderRadius={125} width={250} height={250} border={0} scale={1} /> </Dropzone> Everything looks right in the editor:
Treatment:
handleDrop = dropped => { this.setState({ image: dropped[0] }) }; onClickSave = () => { // This returns a HTMLCanvasElement, it can be made into a data URL or a blob, // drawn on another canvas, or added to the DOM. const canvas = this.refAvatar.current.getImage(); // If you want the image resized to the canvas size (also a HTMLCanvasElement) const canvasScaled = this.refAvatar.current.getImageScaledToCanvas(); const img = canvasScaled.toDataURL(); const rect = this.refAvatar.current.getCroppingRect(); }; As a result, there is a canvasScaled (here is a cropped square picture) and rect .
And how to get a round picture? In their demo in the preview, the roundness is obtained at the expense of css: border-radius: 52.5px; . It will not help me to get a round pikchu and send to the server.

