# Create screenshot on entire screen comprising multiple ignition windows

**URL:** <https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785>\
**Category:** Ignition\
**Created:** [November 5, 2021, 5:27pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785 "2021-11-05T17:27:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanchit.sahay](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@sanchit.sahay](https://forum.inductiveautomation.com/u/sanchit.sahay)\
**Post date:** [November 5, 2021, 5:27pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/1 "2021-11-05T17:27:01Z")

</div>

I am working on Ignition Vision 8.1.2

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/549c4705230c0fbe493e73ab1b6392b2ba3343f9.png)

My application has separate 6 separate windows covering 4 quadrant and 1 header 1 footer, something like image attached

I need to place a screenshot button that saves a single image of entire screen. To my understanding system.print.createPrintJob() or system.print.printToImage() takes only the parentWindow at most. So I dont want to create multiple images of open windows, all need to be in 1 image

Any suggestions how to do this? I don’t have a keyboard in my application else would have given Windows key + PrintScreen button to achieve it

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 5, 2021, 5:29pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/2 "2021-11-05T17:29:10Z")

</div>

> [@sanchit.sahay](#):
>
> Any suggestions how to do this? I don’t have a keyboard in my application else would have given Windows key + PrintScreen button to achieve it

You could probably use the `java.awt.Robot` API to press the Win+PrintScreen.

[https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Robot.html#keyPress(int)](https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Robot.html#keyPress(int))

---

<div class="post-metadata">

**Author:** ![sanchit.sahay](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@sanchit.sahay](https://forum.inductiveautomation.com/u/sanchit.sahay)\
**Post date:** [November 5, 2021, 5:31pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/3 "2021-11-05T17:31:28Z")

</div>

Okay  
That would work, I can reference the image stored in Pictures\screenshot folder

Any other way to do it using ignition functions

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 5, 2021, 5:33pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/4 "2021-11-05T17:33:20Z")

</div>

I don’t know offhand how you would do it for all windows at once. Past results from a forum search seem to be window-specific solutions.

---

<div class="post-metadata">

**Author:** ![sanchit.sahay](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@sanchit.sahay](https://forum.inductiveautomation.com/u/sanchit.sahay)\
**Post date:** [November 5, 2021, 5:35pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/5 "2021-11-05T17:35:32Z")

</div>

Okay thanks! I will try the jawa.awt.Robot API method

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 5, 2021, 5:48pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/6 "2021-11-05T17:48:02Z")

</div>

When you were using `system.print.printToImage` what were you passing in? `event.parent`? Did you try to go deeper (`even.parent.parent`)?

---

<div class="post-metadata">

**Author:** ![sanchit.sahay](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@sanchit.sahay](https://forum.inductiveautomation.com/u/sanchit.sahay)\
**Post date:** [November 15, 2021, 9:24pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/7 "2021-11-15T21:24:04Z")

</div>

That worked!!

I had to go multiple levels deep, I used event.source.parent.parent.parent.parent.parent  
So 4 extra parent levels.  
here’s what came up:

Root Container

Level1 = javax.swing.JLayeredPane[null.layeredPane,0,0,800x600,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,optimizedDrawingPossible=true]

Level2 = javax.swing.JRootPane[,5,22,800x600,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.synth.SynthBorder@5686f2c2,flags=449,maximumSize=,minimumSize=,preferredSize=]  
Level3 = Main Window  
Level4 = VisionApp[demo]

So once it reached the VisionApp level, it saved image of everything thats open!

---

<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:** [November 15, 2021, 10:56pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/8 "2021-11-15T22:56:26Z")

</div>

A shortcut for you using [SwingUtilities](https://docs.oracle.com/javase/8/docs/api/javax/swing/SwingUtilities.html#getAncestorOfClass-java.lang.Class-java.awt.Component-) and [VisionDesktop](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.1/com/inductiveautomation/factorypmi/application/VisionDesktop.html):

```auto
from javax.swing import SwingUtilities
from com.inductiveautomation.factorypmi.application import VisionDesktop
u
appWindow = SwingUtilities.getAncestorOfClass(VisionDesktop, event.source)
system.print.printToImage(appWindow)

```

The advantage of this approach is that it should work with multiple desktops, too.

---

<div class="post-metadata">

**Author:** ![sanchit.sahay](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@sanchit.sahay](https://forum.inductiveautomation.com/u/sanchit.sahay)\
**Post date:** [November 16, 2021, 3:14pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/9 "2021-11-16T15:14:34Z")

</div>

It turned out that my application actually has 6 Vision desktops/containers, one for each quadrant, and 1 each for header and footer.  
So I had to try and use your method. Somehow it also captures only the window from which the event is fired, but not other windows.  
Going through the documentation for [VisionDesktop](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.1/com/inductiveautomation/factorypmi/application/VisionDesktop.html)

---

<div class="post-metadata">

**Author:** ![sanchit.sahay](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@sanchit.sahay](https://forum.inductiveautomation.com/u/sanchit.sahay)\
**Post date:** [November 16, 2021, 3:15pm UTC](https://forum.inductiveautomation.com/t/create-screenshot-on-entire-screen-comprising-multiple-ignition-windows/52785/10 "2021-11-16T15:15:43Z")

</div>

Works only if all vision screens are in single desktop, and single Vision container
