Hello!
I have an Window with an image, loaded from an layout. Now I would like to change the image on using a LPDIRECT3DBASETEXTURE9 that I created on the fly using a RenderSurface ingame. How do I set set the image to the CEGUI::Window?
Also I have another question. Feels stupid to ask about it but I honestly can't find anything about it. How do i Simply load an image from the hardrive, I mean, without using layouts, schemes or whatever. I was looking for something like "LoadImage("image.png");
Kind Regards!
EDIT: SOLVED:
This is my code atm:
LPDIRECT3DBASETEXTURE9 xD3DTexture = TVManager::getSingletonPtr()->m_pCTVInternalObjects->GetTexture(iTextureID);
CEGUI::Direct3D9Renderer * pD3DRender = &CEGUI::Direct3D9Renderer::create(TVManager::getSingletonPtr()->m_pCTVInternalObjects->GetDevice3D());
CEGUI::Texture * pGUITexture = &pD3DRender->createTexture((LPDIRECT3DTEXTURE9)xD3DTexture);
CEGUI::Imageset* tempImageset = &m_pGui->GetImagesetManager()->create( "previewImage", *pGUITexture );
tempImageset->defineImage("previewImage", CEGUI::Point(0.0f,0.0f), CEGUI::Size( 512.0, 512.0 ), CEGUI::Point(0.0f,0.0f));
std::string tmpString = "set: previewImage" + std::string(" image:") + "previewImage";
m_pPreviewWnd->setProperty("Image", tmpString.c_str());
It turns up black though
How to set an image using LPDIRECT3DBASETEXTURE9
Moderators: CEGUI MVP, CEGUI Team
How to set an image using LPDIRECT3DBASETEXTURE9
Last edited by tedlin01 on Wed Dec 08, 2010 16:51, edited 1 time in total.
Re: How to set an image using LPDIRECT3DBASETEXTURE9
About loading images, I think CrEGUI images might abstracted to imagesets. Check this recent thread for a similar question and a possible solution, and some bonus forum drama:
viewtopic.php?f=10&t=5304
viewtopic.php?f=10&t=5304
Re: How to set an image using LPDIRECT3DBASETEXTURE9
tedlin01 wrote:EDIT: SOLVED:...It turns up black though
So is it solved, or not solved? If not, can you post your CEGUI.log as mentioned in the Forum Guidelines; this way we know what version/environment you are using (so we can in/exclude known bugs, etc.). Also, please use the [ code] [/code] tags so that code/logs/etc. sections of your post are easier to distinguish/read. As far as why your texture is all black, the only code you've shown is that of creating and assigning a blank texture - since you've not populated the texture with any color data, that is probably why it is black.
Mikademus wrote:and some bonus forum drama:
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: How to set an image using LPDIRECT3DBASETEXTURE9
CEGUI assumes the texture is RGB or RGBA and you have to tell CEGUI which one it is. Make sure you select the right pixel format! If you fed the texture with something else you have to convert. There is a patch adding support for more pixel formats but AFAIK it hasn't been committed yet.
Seriously, who needs a theater when you can have CEGUI forums!!
Mikademus wrote: and some bonus forum drama
Seriously, who needs a theater when you can have CEGUI forums!!
Who is online
Users browsing this forum: No registered users and 16 guests