+ 2

I am tryng to save the sphere drawn on canvas using p5.js library but it doesn't ,so if Anyone can please help!

https://code.sololearn.com/W9UUP17L2ekB/?ref=app

5th Apr 2020, 4:52 PM
Abhay
Abhay - avatar
6 Antworten
+ 2
You don't have access to your local storage from js inside a web code playground project... In reality, you don't have access from external web pages to the client file system, and even with a web page licated at your device, it's quite impossible to achieve ^^
5th Apr 2020, 5:17 PM
visph
visph - avatar
+ 1
The simplest workaround (but not exactly easy) is to doing some tricks with blob object, and bitmap image base64 url encoding for providing to user a downloadable link... Try to search here or to google for 'js save canvas' ;)
5th Apr 2020, 5:24 PM
visph
visph - avatar
0
visph oh ok ty
5th Apr 2020, 5:20 PM
Abhay
Abhay - avatar
0
visph , honestly I know nothing about bolb object and bitmap thing but I will try figure it out anyway lol! Ty for your response :)
5th Apr 2020, 5:33 PM
Abhay
Abhay - avatar
0
At worst, you could do a screenshot to save your canvas :P
5th Apr 2020, 5:36 PM
visph
visph - avatar
0
Yeah I did that at first 😂
5th Apr 2020, 5:38 PM
Abhay
Abhay - avatar