<script type="text/javascript"> function run() { var cx = canvas.getContext("2d"); canvas.toDataURL("image/png"); } </script> <body onload="run()"> <canvas width="1" height="65536" id="canvas"></canvas>