NasimiAsl Posted September 30, 2017 Share Posted September 30, 2017 hi click on image to see result http://www.babylonjs-playground.com/#1SNQAW#7 worked and see it here http://beta.melyon.ir/snap.html no worked Quote Link to comment Share on other sites More sharing options...
Raggar Posted September 30, 2017 Share Posted September 30, 2017 Hmm. Injecting the non-PG version, I see an encoded image is created, although it doesn't look right. It's just grey, and does not change based on camera rotation or position. The second issue is that, neither setting the image.src or image.setAttribute('src',...) seem to work. The src is changed, but not updated. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted September 30, 2017 Author Share Posted September 30, 2017 i look the Chrome develepor tools i see that src be set with empty image after i click on that Quote Link to comment Share on other sites More sharing options...
Raggar Posted September 30, 2017 Share Posted September 30, 2017 1 minute ago, NasimiAsl said: i look the Chrome develepor tools i see that src be set with empty image after i click on that I'm running the example locally now, and I get the same result. Quote Link to comment Share on other sites More sharing options...
Raggar Posted September 30, 2017 Share Posted September 30, 2017 Ahh. This one worked: https://stackoverflow.com/questions/26783586/canvas-todataurl-returns-blank-image-only-in-firefox var engine = new BABYLON.Engine(canvas, true); var captureFrame = false; ................. ...................... ................. clickii = function(){ captureFrame = true; } ................. ...................... ................. engine.runRenderLoop(function () { scene.render(); if (captureFrame) { var im = document.getElementById("test1"); im.src = canvas.toDataURL(); captureFrame = false; } } NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted September 30, 2017 Author Share Posted September 30, 2017 thanks @Raggar let me test it Quote Link to comment Share on other sites More sharing options...
Raggar Posted September 30, 2017 Share Posted September 30, 2017 The clickii function should simply set the boolean. It works for me in Chrome and FF. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted September 30, 2017 Author Share Posted September 30, 2017 can you share that file? thanks that work Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.