WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Taking screenshots (https://forum.worldviz.com/showthread.php?t=4203)

lionfish 04-16-2012 03:32 AM

Taking screenshots
 
Hello,
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])
viz.window.screenCapture(capture_tex)
data = capture_tex.getImageData()

Then process the 'data' array.

My problem is the screenCapture function
(from here: http://docs.worldviz.com/vizard/comm...eenCapture.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?

Thanks!

Mike.

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


All times are GMT -7. The time now is 07:35 AM.

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