react-image-annotate icon indicating copy to clipboard operation
react-image-annotate copied to clipboard

Unclear on how to use onExit property on Save

Open yaserazfar opened this issue 5 years ago • 4 comments

I am trying to add functionality of the Save button using the annotator but following the documentation I am unsure of how to use the onExit property. Currently I am trying to just print to console the properties of the annotations I have made on an image and I assume that utilising the onExit property is the way to do this.

An example of using the onExit with its type MainLayoutState => any would be really appreciated.

Thank you.

yaserazfar avatar Aug 26 '20 03:08 yaserazfar

This is a great idea!

seveibar avatar Aug 29 '20 02:08 seveibar

@yaserazfar Hi. I'm just wondering if you have managed to figure out the way of using this property, as in the methodology to get the coordinates for the label that you've drawn. Thanks a lot!

andrewtclin avatar Nov 16 '20 08:11 andrewtclin

@yaserazfar Hi. I'm just wondering if you have managed to figure out the way of using this property, as in the methodology to get the coordinates for the label that you've drawn. Thanks a lot!

Hi Andrew, a group member of mine - @andrei-msd was able to get the coordinates of the annotation points by simpily using the onExit function like this: onExit={output => {console.log(JSON.stringify(output.images));}}

yaserazfar avatar Nov 16 '20 22:11 yaserazfar

@yaserazfar Thank you! That's a great help for me. Much appreciated! 👍

andrewtclin avatar Nov 17 '20 01:11 andrewtclin