0

My div contains images from source.

<div id="main">
    <div id="sub1">
        <img src="http://i48.tinypic.com/wrltuc.jpg"
        style="width:150px; height:140px; "/></div>
    <div id="sub2">
         <img src="http://oi41.tinypic.com/24cib61.jpg"
        style="width:120px; height:100px; "/>
    </div>
    <div id="sub3">
          <img src="http://oi50.tinypic.com/1z2j8rd.jpg"
        style="width:60px; height:60px; "/>
    </div>
</div>

<div id="captureBig"></div>
<div id="captureSmall"></div>

I have put capture divs that will contain capture of main div. My working design is here

How can I capture of my main div as a png or jpg image? I am using javascript. I will post it to server.

barteloma
  • 6,403
  • 14
  • 79
  • 173
  • [html2canvas: This script allows you to take "screenshots" of webpages or parts of it, directly on the users browser.](http://html2canvas.hertzen.com/) – t.niese Jan 30 '15 at 22:41
  • If you're just trying to compose pictures in a layout, then I would look at [how to add image to canvas](http://stackoverflow.com/questions/6011378/how-to-add-image-to-canvas) instead. Taking screenshots of a page is a new feature of some browsers, but is still in beta and restricted to certain sites, due to inherent security risks that are a bit complicated to explain (it violates the cross-origin sandbox, a common security principle on the web). – jib Jan 30 '15 at 23:29

0 Answers0