Win10  GTX3.x  osg3.6.4
// test for read image
osg::ref_ptr<osg::Texture2D> texture2d = new osg::Texture2D;
osg::ref_ptr<osg::Image> img = new osg::Image;
img=osgDB::readImageFile("C:\\Users\\Public\\Pictures\\Sample 
Pictures\\Tulips.jpg");
osg::ref_ptr<osg::Image> img2 = new osg::Image;
img2->setImage(img->s(),img->t(),img->r(),img->getInternalTextureFormat(),img->getPixelFormat(),img->getDataType(),img->data(),img->getAllocationMode());
osgDB::writeImageFile(*img2,"img2.jpg");
osgDB::writeImageFile(*img,"abc.jpg");
texture2d->setImage(img);

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/811b3bca-144d-4b55-8301-811f15102cbdn%40googlegroups.com.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to