星期日, 3月 09, 2014

Get Picture's DataURL string

To manipulate canvas's data, the image data must be local, or in relative path.
BSP doesn't have this kinds of environment, but that doesn't mean you have to pay for a Webhost.
Simply embed "DataURL" object code in  img is enough.
This page help you to generate data:image/png;base64






To get your image's DataURL code may need a while, since the text output will be extremely large
Remember to "Allow pop-up window", it will show the code in new window
The code generated here is converted to *.png. It's because the function is called document.getElementById("myImg").toDataURL('image/png')

沒有留言: