Hi,

osg::ref_ptr<osg::Image> image = new osg::Image;
image->readPixels(_x,_y,_width,_height, GL_RGB,GL_UNSIGNED_BYTE);
osgDB::writeImageFile(*image,_filename);

you could add that piece to a osgGA::GUIEventHandler so that it take the snapshot on a key press.

Hope this helps.

Regards
        Arne

Galen Faidley schrieb:
Hello All,

I am updating an application from osgProducer to osgViewer.  The last
bit of functionality I need to replicate is taking a screenshot. I
used osgProducer::Viewer::setWriteImageWhenDone in the past and was
wondering if there was a replacement for it.  I searched the archives
but didn't find anything specifiably addressing a replacement.  I did
find a discussion on creating a high-res screen shots but nothing on
built in functionality.  If osg no longer has this functionality I'm
open to suggestions on the best way to implementing it (I was thinking
something like the prerender example and writing the texture to a
file).

Regards
Galen
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to