Printscreen Plugin with a Photo Gallery

By Dominik Alessandri & Christian Wietlisbach
Hochschule Luzern Technik & Architektur

As part of our bachelor thesis, along with our Kinect module described last month, we developed a printscreen plugin for Open Wonderland. When the plugin is installed on a server, all connected users can choose if screenshots should be saved locally or on the server. If saved on the server, the pictures can be displayed in an automatically updated photo gallery. The update of the picture gallery is made with a shell script which is running as task in the background on the server. We had to implement it this way, as we did not find a way to save directly in the ‘docRoot’ folder in the ‘run’ directory. The shell script uses rsync to keep these two folders in sync.

When a user is connected to a server with the printscreen plugin installed, he can display the controls of the plugin by selecting ‘Window -> Printscreen Folder’:

printscreen_display_window

The Printscreen Folder dialog allows the user to choose where to save the images:

printscreen_settings

When pressing the ‘o’ key, a new screenshot will be taken and either saved locally or on the server. The reason why the key binding was done with ‘o’ is very simple: The printscreen key is not forwarded from the client to the module. The capture of the key event is done on a level before the module gets the event. On this higher level, the “Print Screen” key is filtered and the module doesn’t get any event. Instead the message “Key is not allowed” appears. Version 3 of jMonkey will support taking screenshots by default, making it easier to capture the screen.

On the server-side, the screenshots are saved in /.wonderland-server/0.5/run/content/images/screenshot/. This folder should be created by an administrator when installing the plugin.

To run the photogallery, the content of the file ‘lightbox.zip’ needs to be extracted to /.wonderland-server/0.5/run/docRoot/lightbox/. This photo gallery shows all images stored in /.wonderland-server/0.5/run/docRoot/screenshot/. To update the photo gallery, we need a background task which copies the files from /.wonderland-server/0.5/run/content/images/screenshot/ to /.wonderland-server/0.5/run/docRoot/screenshot/. For example, the shell-script ‘copyScreenshot.sh’ can do the job.

An example of this photo gallery can be seen here: http://147.88.213.71:8080/lightbox/

Photo-gallery

You will need the following files to get the printscreen plugin running:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: