Created
May 9, 2012 10:51
-
-
Save cecilemuller/2643689 to your computer and use it in GitHub Desktop.
Save a screenshot programmatically in BS Contact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#VRML V2.0 utf8 | |
Group { | |
children [ | |
DEF sensor TouchSensor {} | |
Shape { | |
appearance Appearance { | |
material Material {} | |
} | |
geometry Sphere {} | |
} | |
] | |
} | |
DEF script Script { | |
eventIn SFTime onclick | |
url "javascript: | |
function onclick(){ | |
/** | |
* Renders a screenshot of the current scene | |
* @param SFString Output filename | |
* @param SFInt32 Width (in pixels) | |
* @param SFInt32 Height (in pixels) | |
*/ | |
Browser.renderToBitmap('test.jpg', 512, 512); | |
Browser.showConsole(true); | |
trace('The screenshot has been saved'); | |
} | |
" | |
} | |
ROUTE sensor.touchTime TO script.onclick |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment