Team:Cornell/javascripts/mycodraw
From 2013.igem.org
(Difference between revisions)
R.Lizarralde (Talk | contribs) |
R.Lizarralde (Talk | contribs) |
||
Line 8: | Line 8: | ||
var context = canvas.getContext("2d"); | var context = canvas.getContext("2d"); | ||
alert(img.src); | alert(img.src); | ||
- | context.drawImage(img); | + | context.drawImage(img, 0, 0); |
alert(img.src); | alert(img.src); | ||
} | } |
Revision as of 17:48, 16 June 2013
function mycoDraw(canvas) { var canvas = document.getElementById("mycodraw"); var img = canvas.children[0]; //canvas.width = img.width; //canvas.height = img.height; var context = canvas.getContext("2d"); alert(img.src); context.drawImage(img, 0, 0); alert(img.src); }