i’m new to HTML5 and i just want to know how can i save the canvas data ( i have drawn a square on the canvas ). I wanna save x,y,h,w or scale on the database and use that data to recreate the drawing again. How can i do this ?
Thank You.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well you could store them into a mysql database or a server file.
In case of mysql create a table named entities with the columns you want or even 1 column and serialize the data you want to store.
For example
or
then serialize and create your PDO query
this should take care of saving after that is up to you to load what you want whenever you need it by mining the database 🙂
You ‘ll have to be familiar with AJAX -> http://www.w3schools.com/ajax/default.asp
and some server side language like php or asp. Otherwise you could store it locally.