将html div转换为图像

时间:2013-10-26 00:14:32

标签: image html canvas

以下是我想要转换为div的代码。 我尝试了html2canvas,但这并没有起作用。 div的uppelayer middlerlayer和bottomlayer是一个高于其他的3层。

<div id="container">
    <div id="bottomLayer">

        <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSivV5yARSKfCsfaFmdo1Iwc7muglbp92befBPfS7XxglZ0XrpU" id="preview2" />
    </div>

    <div id="mediumLayer">
        <img src="http://f0.pepst.com/c/B7F2F3/402463/ssc3/home/038/amazing.beauties/diana_penty_02_12x92.jpg_480_480_0_64000_0_1_0.jpg" id="preview" />
    </div>

    <div id="main">
        <img src="http://f0.pepst.com/c/B7F2F3/402463/ssc3/home/038/amazing.beauties/diana_penty_02_12x92.jpg_480_480_0_64000_0_1_0.jpg" id="jcrop_target" />
    </div>  

    <div id="upperlayer"><canvas id="canvas2"></canvas></div>
</div>

0 个答案:

没有答案