Canvas troubleshooting: Difference between revisions

Jump to navigation Jump to search
m
Line 263: Line 263:
camera->attach(osg::Camera::COLOR_BUFFER, shot);
camera->attach(osg::Camera::COLOR_BUFFER, shot);
osgDB::writeImageFile(*shot,"canvasImage.png");
osgDB::writeImageFile(*shot,"canvasImage.png");
</syntaxhighlight>
In Canvas space, we can directly access the _texture, e.g.:
<syntaxhighlight lang="cpp">
osg::ref_ptr<osg::Image> image = getTexture()->getImage();
osgDB::writeImageFile( *image, "canvasImage.png" );
</syntaxhighlight>
</syntaxhighlight>


Navigation menu