# Reloading window with Image after switchUser

**URL:** <https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [December 10, 2023, 1:25pm UTC](https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943 "2023-12-10T13:25:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![danFromNj](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@danFromNj](https://forum.inductiveautomation.com/u/danFromNj)\
**Post date:** [December 10, 2023, 1:25pm UTC](https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943/1 "2023-12-10T13:25:35Z")

</div>

I have a project where the login screen has a full screen background Image. After the user logs in, using the system.security.switchuser script, all the open windows are reloaded. I understand that this is the default behavior of this script and I also understand why it is doing it.

When the login page reloads, the background image seems like it has to re-cache. For a brief time, there is no image and instead a small in the center of the window. This has a jarring look to it and I would prefer if there was some way to avoid this.

The image is set to both useCache and loadInBackground. These seem to be the only 2 settings in the Image component that would affect the loading. It almost seems like the image is re-cached.

My other thought is that there is a processing time when scaling the image. The login window is locked at 1024x768. The image that I am loading is 800x600. If the image was re-scaled to 1024x768, would the loading be faster? I guess I can test this part pretty easily.

update::  
I scaled the image to 1024x768 and used the new image as the background. It did not help. When the window reloads after the switchuser script, the image has to reload and the user sees an in the middle of the screen.

Thanks

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2023, 1:55pm UTC](https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943/2 "2023-12-10T13:55:22Z")

</div>

Pretty sure the cache doesn't survive the user switch (probably deliberate, to ensure the cache doesn't hold something the new user is not allowed to see).

Where is the image retrieved from?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [December 10, 2023, 3:04pm UTC](https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943/3 "2023-12-10T15:04:03Z")

</div>

Tip: Ignition doesn't have "screens". Vision has windows and Perspective has views. You've mentioned windows in your post so I've add the vision tag to your question. Please correct it if it is not correct.

---

<div class="post-metadata">

**Author:** ![danFromNj](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@danFromNj](https://forum.inductiveautomation.com/u/danFromNj)\
**Post date:** [December 10, 2023, 5:35pm UTC](https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943/4 "2023-12-10T17:35:44Z")

</div>

@Transistor  
This is in regards to Vision. I have a window that is essentially a splash screen. It is the first window that the user sees when the projects loads.

@pturmel  
The image is stored in Ignition's Image Management.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [December 10, 2023, 5:39pm UTC](https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943/5 "2023-12-10T17:39:47Z")

</div>

You are going to have a period of time when the image is pulled across the network.

Consider creating a svg and then dragging it in to make objects on the screen rather than just the image

---

<div class="post-metadata">

**Author:** ![danFromNj](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@danFromNj](https://forum.inductiveautomation.com/u/danFromNj)\
**Post date:** [December 10, 2023, 5:43pm UTC](https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943/6 "2023-12-10T17:43:58Z")

</div>

I may have found a "solution"; more of a hacky work-around.

Instead of using the Image component, I have switched to a Button component. The button takes up the entire screen. There is no script in the actionPerformed. The Text field is blank. The Image Path field is set to the background image.

When the window is loaded, the image processes much faster. The same goes for after the switchuser script is run.

Like I said, it feels a bit hacky to do it this way. There seems like there should be a way to quickly load images and store them in cache through the Image component.

---

<div class="post-metadata">

**Author:** ![danFromNj](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@danFromNj](https://forum.inductiveautomation.com/u/danFromNj)\
**Post date:** [December 10, 2023, 5:45pm UTC](https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943/7 "2023-12-10T17:45:32Z")

</div>

What is an scg? Do you mean an SVG? The image that I am using is not one that could be created as an SVG. It would either have to be a PNG or a JPG.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [December 10, 2023, 5:51pm UTC](https://forum.inductiveautomation.com/t/reloading-window-with-image-after-switchuser/82943/8 "2023-12-10T17:51:04Z")

</div>

Sorry on phone lol. Yes svg.

A png or jpg has to come from the gateway. So there is se lag when that happens based on the network. If you can make it with native objects then it is quicker response.
