简体   繁体   中英

How to save div and its content as an image on the server?

Actually I am developing a customizable mugs, t-shirts web application. So when user make any changes in the design i want to capture the whole div and want to save it on the server as an image. I googled it but I end up with nothing. Everyone is saying use CANVAS. But I am adding elements using jquery in the div. So i don't know how to change it to canvas.

My Mark Up

<div id="imgs" style="background-color:#222222; color:#fff; width:300px; height:200px">
 // Dynamic Images //Dynamic Content
</div>

I want to save this div as an Image.

Here is my the link of my customizable printing website

Please help me. Thanks

There's no real EASY way to do this. However, if you're adventurous... * Create a Windows Forms application * Embed a browser in the application and have it browse to a URL that contains your div * Have the application take a screenshot of itself. * Save it to disk.

Then when the user makes changes, have your server open up the Win Forms application that you created in a separate process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM