There's a trick : you need to display the image in a classic <img> tag.
When it's done, that image can be pasted on a <canvas>, in a 'classic' way.
You can then do a .toDataURL() from the <canvas>, to have the base64 string representation of that image.
With that image string, you can then do what you want <img src="smileys/smiley2.gif" border="0" align="middle" />.