Hi J-S and others, thank you for you answer. I have changed my code to the code below but I still return out of memory. And also, I try to use *gluScaleImage* but it still return out of memory too.
#include<osg/Image> #include<osgDB/ReadFile> #include<osgDB/WriteFile> #include<iostream> int main(int,char **) { osg::ref_ptr<osg::Image> image = osgDB::readImageFile("Sunset.jpg"); if (image.valid()) { image->scaleImage(256,256,1); } else { std::cout << "Image not found" << std::endl; } return 0; } Best regards, //Phummipat On Mon, Feb 21, 2011 at 4:36 PM, Jean-Sébastien Guay < jean-sebastien.g...@cm-labs.com> wrote: > Hi Phummipat, > > > osg::ref_ptr<osg::Image> image = osgDB::readImageFile("Sunset.bmp"); >> > > Can you at least check that image is not null at this point? > > if (image.valid()) > > image->scaleImage(256,256,1); >> > else > std::cout << "Image not found" << std::endl; > > return 0; >> } >> > > If that's not the problem, run in a debugger and step into scaleImage() and > see why it's failing... > > Hope this helps, > > J-S > -- > ______________________________________________________ > Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com > http://www.cm-labs.com/ > http://whitestar02.webhop.org/ > _______________________________________________ > 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