manuhabitela/drawingboard.js

load saved sketches

h2akim opened this issue · 1 comments

Hi there, is there a feature to load a saved sketches so that user can continue adding or erase drawing after exiting. how webStorage: local is functioning actually.

[User add drawing] -> [database] and retrieve drawing from database and show it on drawingboard.

Thanks :)

webStorage uses the getImg method to retrieve image data and save it to session or localStorage, then uses the setImg method to put it back on the board at initialization.

With these two methods you can do pretty much the same thing with your server instead of localStorage.

A simple example of how to save a sketch server-side is available here, and a real-world example of how to let users create and edit drawings and save it to DB is available in this repo (especially - those - files, there's lot of french in this but you should get the idea).

Good luck!