解决方案 »

  1.   

    试试这个 var image = myCanvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); 
      

  2.   

    谢谢呀~~这个我也试过,放在<img>标签可以,
    但是这样
    var image = myCanvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
    window.shareUrl=image;
    share();
    function share(){
    //d指的是window
    (function(s,d,e){try{}catch(e){}var f='http://v.t.sina.com.cn/share/share.php?',u=d.location.href,p=['&title=',e(window.sharetitle),'&appkey=2924220432','&pic=',e(window.shareUrl)].join('');function a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=620,height=450,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})(screen,document,encodeURIComponent);
    }
    不可以,直接微博分享的页面都打不开了。。如果我把window.shareUrl=“网上任意的图片地址”,就可以显示。。我在想是不是toDataURL返回图片64位编码的问题?