I have create grid using JavaScript and I want to save that grid with some dropped image as a image. here is my link
Asked
Active
Viewed 3,291 times
5
-
Can't be done from a browser. – Hamish Mar 17 '11 at 07:52
-
You want to make a screen capture of the dhtmlgoodies_xpPane div? – Zakaria Mar 17 '11 at 07:54
-
@Zakaria yes I want to save a part of page that is created by jquery. – Moumita Mar 17 '11 at 08:08
-
@Moumita +1 Interesting... and this is useful for applications – bcm Mar 17 '11 at 08:36
-
@Moumita similar question here: http://stackoverflow.com/questions/193221/screen-grab-with-php-and-or-javascript – bcm Mar 17 '11 at 08:39
-
@Moumita This might be useful: https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas#section_9 – bcm Mar 17 '11 at 08:50
-
@Brandon is it possible to save the grid which one I had create. – Moumita Mar 17 '11 at 08:54
-
looks like you got response .... if you manage with js give me an update. – S L Mar 17 '11 at 11:40
-
@experimentX still I'm trying , but didn't get any result.those are too much difficult. – Moumita Mar 17 '11 at 11:47
1 Answers
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