Page 1 of 1

Imageset size strange error

Posted: Tue Jan 04, 2005 15:00
by kabutor
Hi, I try searching but havent found nothing, so Im making some tests with cegui (nice job btw) :) but encountered a strange problem.

I have a 420x200 size tga image so I made a fblogo.imageset like this

Code: Select all

<?xml version="1.0" ?>
<Imageset Name="FreebootersLogo" Imagefile="./cegui/imagesets/fblogo.tga" NativeHorzRes="420" NativeVertRes="200" AutoScaled="true">
        <Image Name="FBLogo" XPos="0" YPos="0" Width="420" Height="200" />
</Imageset>


So later I just load it in like this (jut copy & paste from demo code 7)

Code: Select all

      // replace frame and backdrop images
                 StaticImage* ologo = (StaticImage*)WindowManager::getSingleton().createWindow((utf8*)"TaharezLook/StaticImage", (utf8*)"FrameBoo Logo");
                 panel->addChildWindow(ologo);
                 ologo->setFrameEnabled(false);
                 ologo->setBackgroundEnabled(false);
                 ologo->setImage(&giset->getImage((utf8*)"FBLogo"));
                 ologo->setPosition(Point(0 ,0));
                 ologo->setSize(Size(0.3f, 0.3f));
                 ologo->setAlwaysOnTop(true);
                 ologo->setAlpha(0.9f);
                 ologo->setEnabled(false);
                 ologo->setInheritsAlpha(false);


Amd it shows, but its missing about 50 pixels left of the image, and some ones in the bottom.

Tjhe only way to "fix it" is change in the imageset xml the values in Width="420" Height="200" by Width="511" Height="250" so supposedly Im a bit "out of bounds".

Something Im doing must be wrong no idea Thx for any help

Imageset size strange error

Posted: Wed Jan 05, 2005 19:30
by CrazyEddie
Which renderer was this with?

In any case, your image files should all be saved with the width and height being some power of two, this is basically required due to the nature of the underlying systems (the file is used as a 3D texture, which need to be powers of 2). Depending upon the renderer, the image may be stretched to a more appropriate size, which is giving you the problems you are having.

HTH

CE.

Imageset size strange error

Posted: Thu Jan 06, 2005 15:48
by kabutor
Ogre renderer.

I just resize it to 256x256 and it works fine, really strange as I was working with another 500x500 image with several icons inside and was working fine ?¿

I resize all of them just for sure. Thx :)

request to throw an exception

Posted: Fri Apr 21, 2006 00:03
by turkeypotpie
Hi, could you throw an exception when the imageset's size is not a power of two?

I had the same problem as the above post, and it took me a while to figure it out.

Thanks.

Posted: Tue Apr 25, 2006 16:16
by lindquist
I have added a ticket to our tracker so this is'nt forgotten. And it IS really annoying. Hopefully we can have it fixed before the next release.