advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
931 stars 130 forks source link

Cant Draw Rectangle On Image #221

Closed EnesCeltikk closed 1 year ago

EnesCeltikk commented 1 year ago

Hi, when I click the button, I want to get the coordinate values of the RectangleStencil and draw a rectangle on the photo. My draw code is below, its not working. Nothing happens on the screen. How can i draw rectangle on image? Thanks.

image

Norserium commented 1 year ago

@EnesCeltikk, try this example. Did I understand you correctly?

EnesCeltikk commented 1 year ago

Yes this is what i need exactly. Thank you very much.

What can I do so that the previous drawn rectangles don't delete when the key is pressed? I want to draw multiple rectangles on the photo

Norserium commented 1 year ago

You shouldn't redraw the image on the canvas in this case. But remember, the example is not production ready, there are some pitfalls.

EnesCeltikk commented 1 year ago

Hello again,

I want to draw the red rectangle on the photo where the stencil square is. Not in another photo. What should I use to make changes to the photo we crop?

Example image; image

Norserium commented 1 year ago

@EnesCeltikk, do you want to achieve something like this?

By the way, this API is pretty outdated, so there are a lot of workarounds for different cases. It will be fixed in the next releases. For example, you will receive the possibility to set the custom background component and get the full control of it (like this).