How to change the imageset picture?

aliceliu

30-01-2010 08:56:57

hello.There is something I don't know how to do. We use cegui+ogre to do our project. As we know,all the pictures are put in the media folder,so if we change the pictures in it ,it is easy to pirate for our products. So we want to read the picture from the program instead from the picture file such as aa.png ,bb.jpg and so on. But the *.imageset file contain many information about images,so we want to use a blank picture in *.imageset file,then change the picture in the program.
we use the method:
CEGUI::Texture* myTexture = CEGUI::ImagesetManager::getSingleton().getImageset("GeneralTool")->getTexture();
//GeneralTool is existed imageset name which define in *.imageset file.

myTexture->loadFromMemory(qt_resource_data,16,16,CEGUI::Texture::PixelFormat::PF_RGBA);
//loadFromMemory(const void* buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat) = 0;

static const unsigned char qt_resource_data[] = {
// C:/QT/4.5.3/bin/qrc/image/white1.png
0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
.........................................................
};

we use this method to change the image content which link to the imageset. But the picture show is not correct .I think the method we change picture file to pointer(qt_resource_data[]) is not correct. But I don't know how to change the picture file into the buffer(qt_resource_data[]).Who can tell me?????
or other method can handle my trouble???????????????????

Altren

30-01-2010 16:22:07

This is MyGUI forum and you talking about CEGUI. Better try at CEGUI forums. I'm surprised that you asking it here.