Hi Andrew,

I'm using the ScreenCaptureHandler to capture a screenshot of the current view and save it to disk. I would ideally like to save at a specific resolution, say 1280x1024, however the handler is saving the image at the current size of the viewer.

The ScreenCaptureHandler is not designed to do this. It takes the contents of the graphics context of the given view and saves that to file, so if your graphics context is assigned to a window that is user-resizable then the screen capture will follow the window size.

What you could do is take inspiration from the ScreenCaptureHandler's code to write your own handler that would create an RTT camera with a graphics context of the desired size, capture that in the post draw / final draw callback (so allowing it to render one frame before you capture), and then remove that RTT camera. That would be heavier since at that moment you'd be rendering your scene twice, but it would only take one frame so depending on your scene's complexity you might not even notice.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to