WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Screencapture on exit (https://forum.worldviz.com/showthread.php?t=4571)

Erikvdb 05-07-2013 11:39 AM

Screencapture on exit
 
Hi all,
I have an application in windowed mode that allows users to create some stuff and save a screenshot of it (along with some other data) by pressing an on-screen button. However, I want to make the program foolproof by having it also save a screenshot whenever the user accidentally clicks the X button on the top right of the window, without hitting the save button beforehand.

The problem of course being that viz.window.screenCapture needs another frame to caputure, while the window gets closed immediately upon forcequit. I can still save out the data with an exit event, but not the screenshot.

Is there a workaround to this, other than to stress users to save before quitting or removing the window border so users are forced to exit through script (so I can call the screencap before viz.quit() )?? The latter would kinda suck because I like to be able to resize the window.

farshizzo 05-09-2013 08:59 AM

There is no built-in way to accomplish this with Vizard 3. You might be able to use the pywin32 library to hook the Vizard window and intercept the close button action.

With Vizard 4 you can intercept the clicking of the close button and implement the behavior you want. If you ever decide to upgrade I can provide some sample code.

Erikvdb 05-13-2013 06:33 AM

Alright, thanks for your answer!


All times are GMT -7. The time now is 06:19 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC