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
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.
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