|
发表于 2010-4-26 14:20:05
|
显示全部楼层
我现在想生成一个BMP图,如下代码所示:
osg::ref_ptr<osg::Group> root = new osg::Group;
const int imageWidth = 100;
const int imageHeight = 100;
osg::Vec4Array *imageData = new osg::Vec4Array;
imageData = dealarray();
osg::Image *image1 = new osg::Image;
image1->allocateImage(imageWidth,imageHeight,1,GL_RGBA,GL_FLOAT);
image1->setImage(imageWidth,imageHeight,1,GL_RGBA,GL_RGBA,GL_FLOAT,(unsigned char *)imageData,osg::Image::USE_NEW_DELETE);
osgDB::writeImageFile(*image1,"SSC_1_2.bmp");
可是执行时出现冲突,其中dealarray()是返回一个Vec4Array,不知道哪里出问题了? |
|