Three.js Screenshot

前端 未结 3 1285
梦如初夏
梦如初夏 2021-01-18 04:52

I need to make screenshot of website. I tried using html2canvas and all and it\'s working. But problem is i\'m using THREE.WebGLRenderer and THREE.CSS3DRenderer (for html in

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-18 05:08

    you can use this code var Render=new THREE.WebGLRenderer({antialias: true, preserveDrawingBuffer: true});

    and a function onclick print:

    $("#btn_print").click(function() {
                    window.open( Render.domElement.toDataURL("image/png"), "Final");
                    return false;
                });
    

    Example online: http://develoteca.com/Panel/ clic on button Print

    The key is: {antialias: true, preserveDrawingBuffer: true} in object WebGLRenderer

    ,regards.

    visit:http://develoteca.com

提交回复
热议问题