Babylon canvas to IMG


#1

I used before “createScreenshot” (works greate) but I need to pass that screenshot to an img. Is there a way to achieve that?

Thank you.


#2

Tools.createScreenshot accepts a callback passing in a base64 image url that you can directly set to img.src:
https://doc.babylonjs.com/how_to/render_scene_on_a_png#callback-function


#3

Thanks DK, I’ll check it


#4

Thanks Deltakosh, I used the rendertarget option and it works fine on web.