Open topic with navigation
Capture the screen image to a file or texture
|flags = 0
Specifies the file name or texture object to save the current screen to.
flags = 0
A combination of the following flags:
Capture the screen into an RGBA image instead of RGB.
When capturing the screen to a texture, copy the screen contents directly into the texture object on the GPU, instead of downloading the image to the CPU. This increases screen capture performance for texture objects, however the image data will not be available to the script. When this flag is enabled, the existing texture format determines the capture format, and the viz.CAPTURE_RGBA flag will be ignored.
Use this command to save a copy of the current graphic screen to a file or texture object. This can be used to automate the creation of a sequence of images that are later compiled into a movie.
Note: The image is not generated immediately. Vizard must wait until the next frame is rendered before it can capture the image.
Capturing to image file:
# Capture screen to BMP file
Capturing to texture:
# Create blank texture
capture_tex = viz.addBlankTexture([1,1])
# Capture screen to texture
Copy screen to texture:
# Create render texture
capture_tex = viz.addRenderTexture()
# Copy screen to texture