5

I have create grid using JavaScript and I want to save that grid with some dropped image as a image. here is my link

Kara
  • 6,115
  • 16
  • 50
  • 57
Moumita
  • 360
  • 8
  • 26

1 Answers1

1

If you can restrict this usage to browsers using canvas elements, and with firefox extensions -- so firefox in fact, you can load any part of the DOM in a canvas and extract image for the canvas. Basically:

canvas = document.getElementById("#acanvas"); 
if (canvas.getContext) {
    var context = canvas.getContext('2d');
    context.drawWindow(here_any_part_of_the_DOM_tree_not_only_window);
    var mypng = context.toDataURL();
}
regilero
  • 29,806
  • 6
  • 60
  • 99