andfanilo / streamlit-drawable-canvas

Do you like Quick, Draw? Well what if you could train/predict doodles drawn inside Streamlit? Also draws lines, circles and boxes over background images for annotation.
https://drawable-canvas.streamlit.app/
MIT License
576 stars 88 forks source link

update_streamlit parameter issue #71

Closed Kseniiakv closed 2 years ago

Kseniiakv commented 2 years ago

Hi there! When I set update_streamlit=False, image_data is never updated, and I can't find a way to update the canvas manually when I want to export the resulting image after several strokes. I tried "Download Base64 encoded PNG" example in demo, where this parameter is set to False by default and after exporting png it was blank. Am I doing something wrong?

andfanilo commented 2 years ago

Hello @Kseniiakv !

When update_streamlit is set to False, the returned value by the component won't update until you hit the downward arrow I circled in blue

image

If you click this button then the component will return the image data and then you can use the download as png.

I implemented this because some people draw a lot and did not want the updated image on every stroke, so this parameter batches all strokes together and sends it to you when you click the button. Granted the icon is not...very descriptive :/

If you have a better icon idea let me know :)

Have a nice day, Fanilo

Kseniiakv commented 2 years ago

Thanks a lot, it works!