# View windows Application in an Ignition Window

**URL:** <https://forum.inductiveautomation.com/t/view-windows-application-in-an-ignition-window/18344>\
**Category:** Ignition\
**Created:** [June 7, 2018, 2:58pm UTC](https://forum.inductiveautomation.com/t/view-windows-application-in-an-ignition-window/18344 "2018-06-07T14:58:37Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [June 8, 2018, 5:40pm UTC](https://forum.inductiveautomation.com/t/view-windows-application-in-an-ignition-window/18344/10 "2018-06-08T17:40:29Z")

</div>

That might work. You could put something like this in a gateway timer event script at a rate of every second or so:

```auto
import glob
import os

list_of_files = glob.glob('/path/to/folder/*') # get a list of all files in the folder
latest_file = max(list_of_files, key=os.path.getctime) # filter for only the most recently created file
system.tag.write('latestCameraImagePath', latest_file)

```

Now you have the path to the latest image in the gateway, but you need to get the actual image bytes to the clients. You could either give them access to read the file directly from the gateway (wouldn’t recommend), or have the gateway read in the image bytes and store them in a tag. For the latter approach, you could setup a ValueChange event script on the path tag that populates a byte array tag:

```auto
bytes = system.file.readFileAsBytes(currentValue.value)
system.tag.write(latestCameraImageBytes, bytes)

```

The last step would be to render those bytes in your client window. For that you could attach the following script to a Timer Component on the vision window:

```auto
from javax.swing import ImageIcon

imageComponent = event.source.parent.getComponent("Image")
bytes = system.tag.read(latestCameraImageBytes).value
icon = ImageIcon(bytes)
imageComponent.setIcon(icon)

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/view-windows-application-in-an-ignition-window/18344)._
