0 Replies Latest reply on Jan 6, 2010 7:15 PM by rjs23

    [javascript issue] canvas toDataUrl() issue

    rjs23

      A script contains

      setInterval(miniMapUpdate,3500);
      
      function miniMapUpdate(){
        url=canvas.toDataURL("");
        air.trace("data is: "+url);
      }
      

       

      What toDataURL() does is that it returns canvas as a png base64 data url. I use this function to convert canvas into a img element ("<img src="">)

       

      The problem I'm having in adobe air 1.5.0 with Window Vista 64bits is that toDataUrl() returns blank string instead of data url. It should be at least contain "data: " if canvas is empty but for some reason toDataUrl() keeps returning totally blank.

      Any idea why does this returns blank string?

       

      Perhaps toDataURL function isnt fully supported in 1.5.0?

       

      More information about toDataUrl:

      http://www.w3.org/TR/html5/the-canvas-element.html#dom-canvas-todataurl