View Full Version : Taking screenshots

04-16-2012, 03:32 AM
I'm trying to count the number of pixels of a certain colour in each frame of a scene (don't ask why!!!). It doesn't need to be quick as I'm running through the telemetry afterwards.

My plan is to do something like:

capture_tex = viz.addBlankTexture([1,1])
data = capture_tex.getImageData()

Then process the 'data' array.

My problem is the screenCapture function
(from here: http://docs.worldviz.com/vizard/commands/viz/window/screenCapture.htm )

The top of the page says it takes a string (file to save screenshot to), but the example further down it has a texture object passed to it instead. Is this really possible? When I tried I get an error:

File "C:\Program Files (x86)\WorldViz\Vizard30\python\viz.py", line 8160, in screenCapture
_ipcSend(_VIZ_SCREENCAPTURE,0,0,fileName,0.0,0.0,0 .0,0.0)
TypeError: message must be a string

as if it really needs a string, and passing the texture object isn't correct.

Any ideas?



04-16-2012, 08:30 AM
The docs you are referring to are for Vizard 4.0. You seem to be using Vizard 3.0, which that feature did not exist for.

If you are not able to upgrade to Vizard 4.0, then you can workaround the issue by capturing the screen to a file, then loading that file back into a texture.