Page 1 of 1

Resize a Texture or an Image

Posted: Thu May 03, 2007 21:49
by CaseyB
I am using CEGUI with Ogre and I have an Ogre Texture that I use for RTT and I convert that to a CEGUI texture and use that to create a CEGUI::Image. I put that Image in a FrameWindow and I want the user to be able to resize that window, but I can't seem to find a way to change the size of the CEGUI::Texture or the CEGUI::Image. If I start out with an Ogre Texture that is the exact size of the window everything looks good, but when I resize the window it looks like crap because of the up- / down-sampling that is happening. What's the right way to do this?

Posted: Thu May 03, 2007 21:54
by Pompei2
sorry, what is the exact result you want to have ?

Posted: Thu May 03, 2007 22:02
by CaseyB
I want the user to be able to resize the window without the render texture becoming either pixelated or losing resolution due to down-sampling. Basically I want my Ogre::Texture, CEGUI::Texture and CEGUI::Image to always match the size of the FrameWindow.

Posted: Thu May 03, 2007 22:47
by Pompei2
I don't know anything about ogre textures and cegui textures and their interaction.

If you are displaying the image in a StaticImage widget (or a DefaultWindow), maybe you could take a look at the following two properties:
* VertFormatting
* HorzFormatting
witch both accept the following values:
* "LeftAligned" - Image is left aligned within the prescribed area.
* "CentreAligned" - Image is horizontally centred within the prescribed area.
* "RightAligned" - Image is right aligned within the prescribed area.
* "Stretched" - Image is horizontally stretched to fill the prescribed area.
* "Tiled" - Image is horizontally tiled to fill the prescribed area.
taken from the Falagard System XML Enumerations reference

Hope it helps.

Posted: Fri May 04, 2007 20:45
by daves
Bump!!

Other ideas on how to solve this?