|
楼主 |
发表于 2011-8-3 22:24:16
|
显示全部楼层
回复 2# array
我截图的方法是给相机加一个回调,每一帧view->frame();中截图,
- struct CaptuerDrawCallBack:public osg::Camera::DrawCallback
- {
- CaptuerDrawCallBack(osg::ref_ptr<osg::Image>image)
- {
- _image=image;
- }
- ~CaptuerDrawCallBack(){}
- virtual void operator()(const osg::Camera& camera)const
- {
- osg::ref_ptr<osg::GraphicsContext::WindowingSystemInterface>win;
- _image->allocateImage(720,576,1,GL_RGBA,GL_UNSIGNED_BYTE);
- _image->readPixels(0,0,720,576,GL_RGBA,GL_UNSIGNED_BYTE);
- //osgDB::writeImageFile((*_image.get()),"imageosg.bmp");
- pData=_image->data();
- }
- osg::ref_ptr<osg::Image>_image;
- };
复制代码
请指教,另外我不清楚你说的operation是什么? |
|