I was supposed to publish this in October when I found it, but it went crazy. I was able to find the answer to my question.
Read the post here first HTML 5 Canvas Save Image
Here's how I implemented the solution (get the CanvasSaver function code from the link above):
function SaveCanvas(canvasName) { var canvas = document.getElementById(canvasName); var imgUrl = null; if (canvas.getContext) { //Get alternative image URL for spacetree only if (canvasName.indexOf("tag") == -1) { imgUrl = $jit.ST.prototype.print.call(); } var cs = new CanvasSaver('http://joeltrost.com/php/functions/saveme.php'); //cs.saveJPEG(canvas, 'image'); cs.savePNG(canvas, 'image', imgUrl); } }
Finally, the code for your ASP button to call the SaveCanvas function:
<asp:ImageButton ID="ImageButton1" ImageUrl="Images/save_icon.png" ToolTip="Save Visualization" AlternateText="Save Visualization" OnClientClick="SaveCanvas('tagCloudVis-canvas');return false;" Style="left: 2px; top:3px; position:relative;" runat=server />
source share