Hello community,
I'm stuck in a perhaps small problem but I don't know which way to go.
I'd like to use the image loaders OSG implements. I've succesfully fetched
images from web links and my own HD. However, now I'm trying to do the same
with an image stored in a string, in main memory.
My OSG version is 2.9.9. The extension for the file is png, and considering s
is the string containing the image, I've tried the following portion of code:
Code:
osg::ref_ptr<osg::Image> image;
osgDB::ReaderWriter* rw =
osgDB::Registry::instance()->getReaderWriterForExtension("png");
if (rw)
{
osgDB::ReaderWriter::ReadResult rr = rw->readImage(s);
if ( rr.success() )
image = rr.takeImage();
}
>From debugging the code, I can see the program executes readImage, but since
>rr.success() is false, the image is not taken.
I'm inferring the png plugin doesn't implement this readImage method. Am I
missing something? Would you recommend any solution?
Thank you!
Cheers,
Daniel
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=40344#40344
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org