I have create grid using JavaScript and I want to save that grid with some dropped image as a image. here is my link
-
Can't be done from a browser.Hamish– Hamish2011-03-17 07:52:53 +00:00Commented Mar 17, 2011 at 7:52
-
You want to make a screen capture of the dhtmlgoodies_xpPane div?Zakaria– Zakaria2011-03-17 07:54:58 +00:00Commented Mar 17, 2011 at 7:54
-
@Zakaria yes I want to save a part of page that is created by jquery.Moumita– Moumita2011-03-17 08:08:04 +00:00Commented Mar 17, 2011 at 8:08
-
@Moumita +1 Interesting... and this is useful for applicationsbcm– bcm2011-03-17 08:36:23 +00:00Commented Mar 17, 2011 at 8:36
-
@Moumita similar question here: stackoverflow.com/questions/193221/…bcm– bcm2011-03-17 08:39:41 +00:00Commented Mar 17, 2011 at 8:39
|
Show 4 more comments
1 Answer
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();
}