Shahzaibkhatri

I need help in canvas Screenshot Take Function in Babylon.js

Recommended Posts

1 minute ago, bulisor said:

Thanks For Reply . I also need one more Help I Use Babylon js Render Scene to take screen shot its working Now very well I need Next help is I want a Function to send direct Screen shot to Email   currently when I click on send they download me Png on my computer .  Please Any Guidelines 

Share this post


Link to post
Share on other sites
  size = { width: 600 , height: 400};
    var i = 1;
    function myLoop () {
        setTimeout(function () {
            alert('Taking Screenshot!');
            //Creating png screenshot
            scene.render();
          var a = BABYLON.Tools.CreateScreenshot(engine, camera, {precision: 1});
          var path = "";
            $.ajax({    
             url:"save.php",
             type:'post',
             data: "dir=" + path + "&img=" + textureDynamic._canvas.toDataURL()
            });
            i++;
            if (i < 1) {
                myLoop();
                //console.log(done1);
            }
        }, 5000)
    }
    myLoop();

This is my current function that I use please let me know how I send screen shot to email or server can u wirte for me code

Share this post


Link to post
Share on other sites
1 minute ago, Arte said:

BABYLON.Tools.CreateScreenshot(engine, camera, { width: 500, height: 500 },sendData);

function sendData(base64Image) {

$.ajax({  

............

data : {

screnShot: base64Image

},

................

console.log(base64Image);

}

Thanks for your response i'll let you know ASAP i'm trying this code.... :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.