我试图弄清楚如何将图像/画布保存到 Smart Mobile Studio 的本地文件夹中。这应该是创建右键单击保存到文件夹事件的方法:
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
// draw .................
// save canvas image as data url (png format by default)
var dataURL = canvas.toDataURL();
// set canvasImg image src to dataURL so it can be saved as an image
document.getElementById('canvasImg').src = dataURL;
我希望短信方式是这样的:
W3Cont:=TW3GraphicContext.Create(Null);
W3Cont.Allocate(300,300);
W3Canv:=TW3Canvas.Create(W3Cont);
asm
var dataURL = @W3Canv.toDataURL();
document.getElementById('canvasImg').src = dataURL;
end;
但是短信不知道 toDataUrl !?...