<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic toDataURL is supported on in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/toDataURL/m-p/1039816#M45576</link>
    <description>&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 14.3999996185303px;"&gt;toDataURL is supported on crosswalk. toDataURL works on the canvas element, I think in your code you are applying toDataURL on the context.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 14.3999996185303px;"&gt;Try doing this :&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;var canvas = document.getElementById('avatarCanvas');

alert( canvas.toDataURL('image/png') );&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Swati&lt;/P&gt;</description>
    <pubDate>Thu, 12 Mar 2015 00:28:26 GMT</pubDate>
    <dc:creator>Swati_S_Intel1</dc:creator>
    <dc:date>2015-03-12T00:28:26Z</dc:date>
    <item>
      <title>toDataURL</title>
      <link>https://community.intel.com/t5/Software-Archive/toDataURL/m-p/1039815#M45575</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I toDataURL function supported on a canvas for a crosswalk deployment ?&lt;BR /&gt;
	Do I need plugin ?&lt;/P&gt;

&lt;P&gt;this code:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;var ctx = document.getElementById('avatarCanvas').getContext('2d');
ar img = new Image();
img.src = url;
img.onload = function () {
ctx.drawImage(img,0,0);
    
alert( ctx.toDataURL('image/png') );   &lt;/PRE&gt;

&lt;P&gt;fails with "undefined" function&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 07:14:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/toDataURL/m-p/1039815#M45575</guid>
      <dc:creator>Spiros_N_</dc:creator>
      <dc:date>2015-03-07T07:14:08Z</dc:date>
    </item>
    <item>
      <title>toDataURL is supported on</title>
      <link>https://community.intel.com/t5/Software-Archive/toDataURL/m-p/1039816#M45576</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 14.3999996185303px;"&gt;toDataURL is supported on crosswalk. toDataURL works on the canvas element, I think in your code you are applying toDataURL on the context.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 14.3999996185303px;"&gt;Try doing this :&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;var canvas = document.getElementById('avatarCanvas');

alert( canvas.toDataURL('image/png') );&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Swati&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2015 00:28:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/toDataURL/m-p/1039816#M45576</guid>
      <dc:creator>Swati_S_Intel1</dc:creator>
      <dc:date>2015-03-12T00:28:26Z</dc:date>
    </item>
    <item>
      <title>As Swati points out,</title>
      <link>https://community.intel.com/t5/Software-Archive/toDataURL/m-p/1039817#M45577</link>
      <description>&lt;DIV class="content"&gt;As Swati points out, toDataUrl is a property of a canvas element, not a canvas context. I think you should have code like this:
	&lt;DL class="codebox"&gt;
		&lt;DT&gt;&amp;nbsp;&lt;/DT&gt;
		&lt;DD&gt;
			&lt;PRE class="brush:jscript;"&gt;var el = document.getElementById('avatarCanvas');
var ctx = el.getContext('2d');
var img = new Image();
img.src = url;
img.onload = function () {
    ctx.drawImage(img,0,0);
   
    alert( el.toDataURL('image/png') );   
}&lt;/PRE&gt;
		&lt;/DD&gt;
	&lt;/DL&gt;
	&lt;BR /&gt;
	You may also have to deal with cross origin problems (e.g. "img.crossOrigin = true;") but this seemed to work for me.&lt;BR /&gt;
	&lt;BR /&gt;
	&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Mar 2015 00:46:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/toDataURL/m-p/1039817#M45577</guid>
      <dc:creator>Dale_S_Intel</dc:creator>
      <dc:date>2015-03-12T00:46:20Z</dc:date>
    </item>
    <item>
      <title>OK Thank you all for your</title>
      <link>https://community.intel.com/t5/Software-Archive/toDataURL/m-p/1039818#M45578</link>
      <description>&lt;P&gt;OK Thank you all for your help !&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2015 06:25:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/toDataURL/m-p/1039818#M45578</guid>
      <dc:creator>Spiros_N_</dc:creator>
      <dc:date>2015-03-12T06:25:43Z</dc:date>
    </item>
  </channel>
</rss>

