var saveAsLocalImage = function () {
var canvas = document.getElementById("theCanvasId");
//直接改图片的mimeType,强制改成steam流类型的。比如"image/octet-stream"
var image = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
window.location.href = image;
}