# Screenshots without GUI

**URL:** <https://forum.babylonjs.com/t/screenshots-without-gui/4630>\
**Category:** Questions\
**Tags:** gui\
**Created:** [July 21, 2019, 12:14pm UTC](https://forum.babylonjs.com/t/screenshots-without-gui/4630 "2019-07-21T12:14:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ueli](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ueli/32/2466_2.png) [@ueli](https://forum.babylonjs.com/u/ueli)\
**Post date:** [July 21, 2019, 12:14pm UTC](https://forum.babylonjs.com/t/screenshots-without-gui/4630/1 "2019-07-21T12:14:04Z")

</div>

Hi There  
I’m wondering if there’s a possibility to disable the GUI for screenshots (render to png)

The way i’m doing it now is stupid: put the GUI in the background, wait 1sec, do the screenshot, wait 2sec and re-put the GUI back to the foreground…

> function guiToForeground() {  
> babylonGUI.isForeground = true;  
> };
> 
> meContTopSaveImage.onPointerClickObservable.add(function () {
> 
> ```
> babylonGUI.isForeground = false;
> setTimeout(function(){
> setTimeout(function(){
> guiToForeground();
> },2000);
> BABYLON.Tools.CreateScreenshot(engine, camera1, {precision: 1.0});
> },1000);
> });
> 
> ```

I just wanted to ask here if there’s a better way to do it.

I tried it with the onSuccess callback:

> function guiToForeground() {  
> babylonGUI.isForeground = true;  
> };
> 
> meContTopSaveImage.onPointerClickObservable.add(function () {  
> babylonGUI.isForeground = false;  
> setTimeout(function(){  
> BABYLON.Tools.CreateScreenshot(engine, camera1, {precision: 1.0}, guiToForeground);  
> },2000);  
> });

It puts the GUi for 2 seconds in the back, but it does not take the screenshot anymore…

thanks

---

<div class="post-metadata">

**Author:** ![MarianG](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mariang/32/138_2.png) [@MarianG](https://forum.babylonjs.com/u/MarianG)\
**Post date:** [July 21, 2019, 3:13pm UTC](https://forum.babylonjs.com/t/screenshots-without-gui/4630/2 "2019-07-21T15:13:16Z")

</div>

[https://www.babylonjs-playground.com/#3GPEIL#1](https://www.babylonjs-playground.com/#3GPEIL#1)

---

<div class="post-metadata">

**Author:** ![ueli](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ueli/32/2466_2.png) [@ueli](https://forum.babylonjs.com/u/ueli)\
**Post date:** [July 22, 2019, 7:27am UTC](https://forum.babylonjs.com/t/screenshots-without-gui/4630/3 "2019-07-22T07:27:36Z")

</div>

perfect - thank you very much! 🙂
