douju7245 2012-11-06 14:10
浏览 11

将div的内容转换为图像

I am creating an image editor type web application. I have a main div which will contain many div inside it.

When the user clicks on a save button, I want to save the main div as an image in a folder. I tried doing it using Canvas.toDataURL() but then I found that i cant place a div(main div) inside canvas tags. I also tried imagegrabscreen() function of php but it captured the screen before the whole page is loaded, so it was of no use.

Can anybody help me and suggest a way to implement this using php or javascript?

  • 写回答

3条回答 默认 最新

  • douke6857 2012-11-06 14:12
    关注

    Why are you using a bunch of divs when you could just use one canvas and draw on it with proper canvas functions?

    There are plenty of examples of what you're trying to do, such as this one.

    评论

报告相同问题?