How I can save an image in Canvas Control to WebSQL?
How I can save an image in Canvas Control to WebSQL? My application is a jQuery Mobile Application.
Here I found a clue for my answer
How save canvas as image?
var img = new WriteableBitmap(myCanvas, null);
But this img开发者_StackOverflow社区 how I can Save in my WebSql database? How do I convert this if I want to save it in an SQL SERVER table(Image DataType)?
I'll appreciate any help on this.
This image we can store in web sql in 'TEXT' datatype.
var canvas = document.getElementById('canvas');
MyImage = canvas.toDataURL('image/jpeg');
For previewing this, this 'MyImage' dataurl can set to any Image object 'src'.
var img = new Image();
img.src = MyImage;
精彩评论