Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Take a snapshot of a div

I have a <div> with an image in it. The image can be resized by users input, also items can be added to the current image. Once finished I would like the user to be able to save this image they created.

I have used MVC4 and jQuery to build the project. Is there anyway to save a snapshot of the created item? I have looked at canvas but this would not work in my case.

Thanks

like image 466
CR41G14 Avatar asked Oct 21 '22 16:10

CR41G14


1 Answers

Intriguing question:

You can start here: http://html2canvas.hertzen.com/ a library that allows you to "copy" HTML into canvas.

Then, go here: Uploading 'canvas' image data to the server

An answer that shows you how to send the canvas image to the server.

There you have it.

Disclaimer: have not tried myself, but I'm now dying to. Work deadlines not allowing :)

like image 146
Adriano Carneiro Avatar answered Nov 04 '22 20:11

Adriano Carneiro